From a5c7dc87bb9f2872483f40482060a645e00e7557 Mon Sep 17 00:00:00 2001 From: Alon Swartz Date: Wed, 19 Apr 2017 14:28:29 +0300 Subject: [PATCH] added trackpoint polling delay to fix dropped keystrokes --- tmk_core/common/keyboard.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index eb7b096bed..518b42481e 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -43,6 +43,10 @@ along with this program. If not, see . #include "adb.h" #endif +#ifdef PS2_MOUSE_ENABLE +static uint32_t ps2_mouse_poll_time = 0; +static int ps2_mouse_poll_interval = 10; // milliseconds +#endif #ifdef MATRIX_HAS_GHOST static bool has_ghost_in_row(uint8_t row) @@ -74,6 +78,7 @@ void keyboard_init(void) matrix_init(); #ifdef PS2_MOUSE_ENABLE ps2_mouse_init(); + ps2_mouse_poll_time = timer_read32(); #endif #ifdef SERIAL_MOUSE_ENABLE serial_mouse_init(); @@ -152,7 +157,10 @@ void keyboard_task(void) #endif #ifdef PS2_MOUSE_ENABLE - ps2_mouse_task(); + if ( timer_elapsed32( ps2_mouse_poll_time ) >= ps2_mouse_poll_interval ) { + ps2_mouse_task(); + ps2_mouse_poll_time = timer_read32(); + } #endif #ifdef SERIAL_MOUSE_ENABLE