Commit 5e1c21ddf004

Vincent Demeester <vincent@sbr.pm>
2025-12-09 11:31:47
fix(moonlander): Extract base keycode in numword layer-tap check
- Prevent numword from quitting when using backspace/space/enter - Handle layer-tap wrapped keys by extracting underlying keycode - Support both LT() and MT() wrapped keycodes in numword checks Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 0409e37
Changed files (1)
keyboards
moonlander
keyboards/moonlander/config/layermodes.c
@@ -44,6 +44,17 @@ void process_num_word_activation(uint8_t layer, const keyrecord_t *record) {
 // Note: F-keys (F1-F15) are intentionally NOT in this list, so they will
 // send from the NUMB layer and then automatically disable numword
 static bool is_num_word_key(uint16_t keycode) {
+    // Extract base keycode from layer-tap, mod-tap, etc.
+    // This handles cases like LT(NAVI,KC_BSPC) -> KC_BSPC
+    switch (keycode) {
+        case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
+            keycode = keycode & 0xFF;  // Extract the base keycode
+            break;
+        case QK_MOD_TAP ... QK_MOD_TAP_MAX:
+            keycode = keycode & 0xFF;  // Extract the base keycode
+            break;
+    }
+
     switch (keycode) {
         // Numbers
         case KC_1 ... KC_0: