summaryrefslogtreecommitdiffstats
path: root/quantum/action_util.h
diff options
context:
space:
mode:
authorprecondition <57645186+precondition@users.noreply.github.com>2023-07-07 16:18:02 +0200
committerGitHub <noreply@github.com>2023-07-08 00:18:02 +1000
commit1abf8f3e8b8a9b358be3c27867f9bee7422507f3 (patch)
tree22df0acf90ca877cf4b1066116704a310227be99 /quantum/action_util.h
parentbaf289112460d73e889a8a442a932bc4198ccc05 (diff)
[Feature] Send a dummy keycode to neutralize flashing modifiers in retro tap and key overrides (#20992)
Diffstat (limited to 'quantum/action_util.h')
-rw-r--r--quantum/action_util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/quantum/action_util.h b/quantum/action_util.h
index 02f6e9e6df..831caf3c0a 100644
--- a/quantum/action_util.h
+++ b/quantum/action_util.h
@@ -102,6 +102,19 @@ void use_oneshot_swaphands(void);
void clear_oneshot_swaphands(void);
#endif
+#ifdef DUMMY_MOD_NEUTRALIZER_KEYCODE
+// KC_A is used as the lowerbound instead of QK_BASIC because the range QK_BASIC...KC_A includes
+// internal keycodes like KC_NO and KC_TRANSPARENT which are unsuitable for use with `tap_code(kc)`.
+# if !(KC_A <= DUMMY_MOD_NEUTRALIZER_KEYCODE && DUMMY_MOD_NEUTRALIZER_KEYCODE <= QK_BASIC_MAX)
+# error "DUMMY_MOD_NEUTRALIZER_KEYCODE must be a basic, unmodified, HID keycode!"
+# endif
+void neutralize_flashing_modifiers(uint8_t active_mods);
+#endif
+#ifndef MODS_TO_NEUTRALIZE
+# define MODS_TO_NEUTRALIZE \
+ { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) }
+#endif
+
#ifdef __cplusplus
}
#endif