diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index b490fbfe31dc..61f302f168b4 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -194,26 +194,29 @@ void matrix_scan_keymap(void) { bool process_record_keymap(uint16_t keycode, keyrecord_t* record) { switch (keycode) { case TT(_MOUSE): - { - if (record->event.pressed) { - mouse_keycode_tracker++; - } else { + if (record->event.pressed) { + mouse_keycode_tracker++; + } else { # if TAPPING_TOGGLE != 0 - if (record->tap.count == TAPPING_TOGGLE) { - tap_toggling ^= 1; + if (record->tap.count == TAPPING_TOGGLE) { + tap_toggling ^= 1; # if TAPPING_TOGGLE == 1 - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; + if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; # else - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; + if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; # endif - } else { - mouse_keycode_tracker--; - } -# endif + } else { + mouse_keycode_tracker--; } - mouse_timer = timer_read(); - break; +# endif } + mouse_timer = timer_read(); + break; + case TG(_MOUSE): + if (record->event.pressed) { + tap_toggling ^= 1; + } + break; case MO(_MOUSE): case DPI_CONFIG: case KC_MS_UP ... KC_MS_WH_RIGHT: @@ -222,6 +225,11 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t* record) { break; default: if (IS_NOEVENT(record->event)) break; + if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) { + record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; + mouse_timer = timer_read(); + break; + } if (layer_state_is(_MOUSE) && !mouse_keycode_tracker) { layer_off(_MOUSE); }