]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add support for RETRO_TAPPING to LT(layer, kc)
authorlambda_sakura <lambda.sakura@gmail.com>
Wed, 25 Apr 2018 10:14:27 +0000 (19:14 +0900)
committerDrashna Jaelre <drashna@live.com>
Fri, 25 Jan 2019 19:27:14 +0000 (11:27 -0800)
tmk_core/common/action.c
tmk_core/common/action.h

index b99c2acaa7a9211c5f7848aa1014b9b39c9f57a5..ec8d6ed7b9cbc1dee1d7eb3a2932e6e7135867df 100644 (file)
@@ -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:
index 8e47e5339edaa8229ef0edb4efac87ca34158d03..799e3bb0efd52d5a7a400145c4ef6a8b1cdfaaad 100644 (file)
@@ -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);