diff options
-rw-r--r-- | common/keyboard_8042.c | 2 | ||||
-rw-r--r-- | common/keyboard_mkbp.c | 3 | ||||
-rw-r--r-- | common/keyboard_scan.c | 6 | ||||
-rw-r--r-- | include/keyboard_scan.h | 5 |
4 files changed, 13 insertions, 3 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c index 931583ecfd..834fcf866d 100644 --- a/common/keyboard_8042.c +++ b/common/keyboard_8042.c @@ -382,7 +382,7 @@ static void set_typematic_key(const uint8_t *scan_code, int32_t len) typematic_len = len; } -static void clear_typematic_key(void) +void clear_typematic_key(void) { typematic_len = 0; } diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c index 204268e76f..e6d06c30fb 100644 --- a/common/keyboard_mkbp.c +++ b/common/keyboard_mkbp.c @@ -356,6 +356,9 @@ void keyboard_send_battery_key(void) keyboard_fifo_add(state); } +void clear_typematic_key(void) +{ } + /*****************************************************************************/ /* Host commands */ static uint32_t get_supported_buttons(void) diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index 876d06c9fc..fa8ce3d98f 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -122,10 +122,12 @@ static int keyboard_scan_is_enabled(void) void keyboard_scan_enable(int enable, enum kb_scan_disable_masks mask) { /* Access atomically */ - if (enable) + if (enable) { atomic_clear((uint32_t *)&disable_scanning_mask, mask); - else + } else { atomic_or((uint32_t *)&disable_scanning_mask, mask); + clear_typematic_key(); + } /* Let the task figure things out */ task_wake(TASK_ID_KEYSCAN); diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h index faba74ffe1..94457dd16d 100644 --- a/include/keyboard_scan.h +++ b/include/keyboard_scan.h @@ -98,6 +98,11 @@ enum kb_scan_disable_masks { * @param mask Disable reasons from kb_scan_disable_masks */ void keyboard_scan_enable(int enable, enum kb_scan_disable_masks mask); + +/** + * Clears typematic key + */ +void clear_typematic_key(void); #else static inline void keyboard_scan_enable(int enable, enum kb_scan_disable_masks mask) { } |