From e98c501a614385132a2e2a61a1242f12bab89969 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 27 Oct 2015 19:10:36 -0400 Subject: almost there - keymap_key_to_keycode returning 16bits, maybe --- tmk_core/common/action.c | 4 ++-- tmk_core/common/action.h | 3 ++- tmk_core/common/action_layer.c | 8 ++++---- tmk_core/common/action_layer.h | 2 +- tmk_core/common/action_tapping.c | 2 +- tmk_core/common/keymap.c | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) (limited to 'tmk_core/common') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 1f15bd0918..01692981ea 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -62,7 +62,7 @@ void process_action(keyrecord_t *record) if (IS_NOEVENT(event)) { return; } - action_t action = layer_switch_get_action(event.key); + action_t action = layer_switch_get_action(record, event.key); dprint("ACTION: "); debug_action(action); #ifndef NO_ACTION_LAYER dprint(" layer_state: "); layer_debug(); @@ -511,7 +511,7 @@ void clear_keyboard_but_mods(void) bool is_tap_key(keypos_t key) { - action_t action = layer_switch_get_action(key); + action_t action = layer_switch_get_action(NULL, key); switch (action.kind.id) { case ACT_LMODS_TAP: diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 8a4736d7bc..16a1ed4b3f 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -19,6 +19,7 @@ along with this program. If not, see . #include #include +#include #include "keyboard.h" #include "keycode.h" #include "action_code.h" @@ -50,7 +51,7 @@ typedef struct { void action_exec(keyevent_t event); /* action for key */ -action_t action_for_key(uint8_t layer, keypos_t key); +action_t action_for_key(keyrecord_t *record, uint8_t layer, keypos_t key); /* macro */ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index c535615f44..8dfb35b626 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -112,7 +112,7 @@ void layer_debug(void) -action_t layer_switch_get_action(keypos_t key) +action_t layer_switch_get_action(keyrecord_t *record, keypos_t key) { action_t action; action.code = ACTION_TRANSPARENT; @@ -122,17 +122,17 @@ action_t layer_switch_get_action(keypos_t key) /* check top layer first */ for (int8_t i = 31; i >= 0; i--) { if (layers & (1UL<