aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine R. Dumont <ardumont@users.noreply.github.com>2021-06-24 04:24:31 +0200
committerGitHub <noreply@github.com>2021-06-24 12:24:31 +1000
commitf5cecffab2a32db5db9177aab79226a00013db81 (patch)
treebfd56b4309d9b9c5e2b910dbb986a5e62758fb3f
parent5e86a11a8d49928f06609e9ee1b9ef86c45f3f2e (diff)
downloadqmk_firmware-f5cecffab2a32db5db9177aab79226a00013db81.tar.gz
qmk_firmware-f5cecffab2a32db5db9177aab79226a00013db81.zip
keymap/ardumont: Fix substitute keycode reset step (#12675)
It so happens that when releasing the control key prior to the main key (C-h, C-i, C-n, ...), the substituted keycode was continuously sent in a loop after that (even when releasing said key). The workaround so far was to type any other key to stop the loop. This commit fixes such behavior by resetting the substitution keycode sent when the ctrl released situation conditional is detected (and that the substitution keycode was on).
-rw-r--r--keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c b/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c
index 3bde667ee..6faabbc3e 100644
--- a/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c
+++ b/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c
@@ -97,8 +97,7 @@ bool substitute_keycode(uint16_t keycode, keyrecord_t *record, uint8_t mod_state
97 // Do not let QMK process the keycode further 97 // Do not let QMK process the keycode further
98 return false; 98 return false;
99 } else { 99 } else {
100 // In case substitude_keycode is still being sent even after the release of 100 // In case substitude_keycode is still even after release of the key
101 // the key
102 if (key_registered) { 101 if (key_registered) {
103 unregister_code(substitute_keycode); 102 unregister_code(substitute_keycode);
104 key_registered = false; 103 key_registered = false;
@@ -106,6 +105,12 @@ bool substitute_keycode(uint16_t keycode, keyrecord_t *record, uint8_t mod_state
106 return false; 105 return false;
107 } 106 }
108 } 107 }
108 } else { // ctrl got released
109 // In case substitude_keycode is still sent after release of the ctrl key
110 if (key_registered) {
111 unregister_code(substitute_keycode);
112 key_registered = false;
113 }
109 } 114 }
110 // Else, let QMK process the keycode as usual 115 // Else, let QMK process the keycode as usual
111 return true; 116 return true;