]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/process_keycode/process_tap_dance.c
[Keymap] Jarred's Plaid keymap (#6049)
[qmk_firmware.git] / quantum / process_keycode / process_tap_dance.c
index 94dd17c2fc0dfc68eae594ac1fc6722756f65203..16d33dddeee534471d1e91d9ab8bc7e41fca732c 100644 (file)
 #include "quantum.h"
 #include "action_tapping.h"
 
+#ifndef TAPPING_TERM
+#define TAPPING_TERM 200
+#endif
+
+#ifndef NO_ACTION_ONESHOT
 uint8_t get_oneshot_mods(void);
+#endif
 
 static uint16_t last_td;
 static int8_t highest_td = -1;
@@ -125,6 +131,7 @@ void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) {
       if (keycode == action->state.keycode && keycode == last_td)
         continue;
       action->state.interrupted = true;
+      action->state.interrupting_keycode = keycode;
       process_tap_dance_action_on_dance_finished (action);
       reset_tap_dance (&action->state);
     }
@@ -146,7 +153,11 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
       action->state.keycode = keycode;
       action->state.count++;
       action->state.timer = timer_read();
+#ifndef NO_ACTION_ONESHOT
       action->state.oneshot_mods = get_oneshot_mods();
+#else
+      action->state.oneshot_mods = 0;
+#endif
       action->state.weak_mods = get_mods();
       action->state.weak_mods |= get_weak_mods();
       process_tap_dance_action_on_each_tap (action);
@@ -199,5 +210,6 @@ void reset_tap_dance (qk_tap_dance_state_t *state) {
   state->count = 0;
   state->interrupted = false;
   state->finished = false;
+  state->interrupting_keycode = 0;
   last_td = 0;
 }