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 bc088f12875f..b490fbfe31dc 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -155,26 +155,29 @@ static uint16_t mouse_debounce_timer = 0; static uint8_t mouse_keycode_tracker = 0; bool tap_toggling = false; -void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { - if ((x || y) && timer_elapsed(mouse_timer) > 125) { - mouse_timer = timer_read(); - if (!layer_state_is(_MOUSE) && !(layer_state_is(_GAMEPAD) || layer_state_is(_DIABLO)) && timer_elapsed(mouse_debounce_timer) > 125) { - layer_on(_MOUSE); - } - } - # ifdef TAPPING_TERM_PER_KEY - if (timer_elapsed(mouse_debounce_timer) > get_tapping_term(KC_BTN1, NULL) +# define TAP_CHECK get_tapping_term(KC_BTN1, NULL) # else - if (timer_elapsed(mouse_debounce_timer) > TAPPING_TERM +# ifndef TAPPING_TERM +# define TAPPING_TERM 200 +# endif +# define TAP_CHECK TAPPING_TERM # endif - || (layer_state_is(_GAMEPAD) || layer_state_is(_DIABLO))) { - mouse_report->x = x; - mouse_report->y = y; - } + +void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { + if (x != 0 && y != 0) { + mouse_timer = timer_read(); # ifdef OLED_DRIVER_ENABLE - if (x || y) oled_timer = timer_read32(); + oled_timer = timer_read32(); # endif + if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { + mouse_report->x = x; + mouse_report->y = y; + if (!layer_state_is(_MOUSE)) { + layer_on(_MOUSE); + } + } + } } void matrix_scan_keymap(void) {