summaryrefslogtreecommitdiff
path: root/tmk_core/common/action.c
diff options
context:
space:
mode:
authorjpetermans <tibcmhhm@gmail.com>2017-05-24 11:51:20 -0700
committerjpetermans <tibcmhhm@gmail.com>2017-05-24 11:51:20 -0700
commit2dcd6c38fa478b40a973c9411c3f5b4c87ae0ba7 (patch)
tree289d5cce94ad5883741f0b637749d87680c14d33 /tmk_core/common/action.c
parentd89114400c398b900e27bf324a7973d1e0f25e58 (diff)
parent7a4ec3bd926865e490fbf7c5ec68d762e998683f (diff)
Merge remote-tracking branch 'upstream/master' into infinity60
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r--tmk_core/common/action.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 94de36918d..a534f818ec 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "action_macro.h"
#include "action_util.h"
#include "action.h"
+#include "wait.h"
#ifdef DEBUG_ACTION
#include "debug.h"
@@ -140,7 +141,6 @@ void process_record(keyrecord_t *record)
void process_action(keyrecord_t *record, action_t action)
{
- bool do_release_oneshot = false;
keyevent_t event = record->event;
#ifndef NO_ACTION_TAPPING
uint8_t tap_count = record->tap.count;
@@ -152,6 +152,7 @@ void process_action(keyrecord_t *record, action_t action)
}
#ifndef NO_ACTION_ONESHOT
+ bool do_release_oneshot = false;
// notice we only clear the one shot layer if the pressed key is not a modifier.
if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) {
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
@@ -438,6 +439,9 @@ void process_action(keyrecord_t *record, action_t action)
} else {
if (tap_count > 0) {
dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n");
+ if (action.layer_tap.code == KC_CAPS) {
+ wait_ms(80);
+ }
unregister_code(action.layer_tap.code);
} else {
dprint("KEYMAP_TAP_KEY: No tap: Off on release\n");
@@ -537,6 +541,21 @@ void process_action(keyrecord_t *record, action_t action)
break;
}
+#ifndef NO_ACTION_LAYER
+ // if this event is a layer action, update the leds
+ switch (action.kind.id) {
+ case ACT_LAYER:
+ #ifndef NO_ACTION_TAPPING
+ case ACT_LAYER_TAP:
+ case ACT_LAYER_TAP_EXT:
+ #endif
+ led_set(host_keyboard_leds());
+ break;
+ default:
+ break;
+ }
+#endif
+
#ifndef NO_ACTION_ONESHOT
/* Because we switch layers after a oneshot event, we need to release the
* key before we leave the layer or no key up event will be generated.