diff options
author | lambda_sakura <lambda.sakura@gmail.com> | 2018-04-25 12:14:27 +0200 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-01-25 20:27:14 +0100 |
commit | 8e47f64888b4b9edfcf6038d2dac0ec7d95623c1 (patch) | |
tree | a70facaa6fbd66539e5db5693cb7738ba8791fdb | |
parent | 0ba9620d6541e5ade89271eccc7371d5a8a3ad15 (diff) | |
download | qmk_firmware-8e47f64888b4b9edfcf6038d2dac0ec7d95623c1.tar.gz qmk_firmware-8e47f64888b4b9edfcf6038d2dac0ec7d95623c1.tar.xz |
Add support for RETRO_TAPPING to LT(layer, kc)
-rw-r--r-- | tmk_core/common/action.c | 10 | ||||
-rw-r--r-- | tmk_core/common/action.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index b99c2acaa..ec8d6ed7b 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -653,7 +653,7 @@ void process_action(keyrecord_t *record, action_t action) #ifndef NO_ACTION_TAPPING #ifdef RETRO_TAPPING - if (!is_tap_key(record->event.key)) { + if (!is_tap_action(action)) { retro_tapping_counter = 0; } else { if (event.pressed) { @@ -929,7 +929,15 @@ void clear_keyboard_but_mods_and_keys() bool is_tap_key(keypos_t key) { action_t action = layer_switch_get_action(key); + return is_tap_action(action); +} +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +bool is_tap_action(action_t action) +{ switch (action.kind.id) { case ACT_LMODS_TAP: case ACT_RMODS_TAP: diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 8e47e5339..799e3bb0e 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -97,6 +97,7 @@ void clear_keyboard_but_mods(void); void clear_keyboard_but_mods_and_keys(void); void layer_switch(uint8_t new_layer); bool is_tap_key(keypos_t key); +bool is_tap_action(action_t action); #ifndef NO_ACTION_TAPPING void process_record_tap_hint(keyrecord_t *record); |