diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index fa8ce3d98f..3ad4805b90 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -272,6 +272,7 @@ static int read_matrix(uint8_t *state) return pressed ? 1 : 0; } +#ifdef CONFIG_KEYBOARD_RUNTIME_KEYS /** * Check special runtime key combinations. * @@ -365,6 +366,7 @@ static int check_runtime_keys(const uint8_t *state) return 0; } +#endif /* CONFIG_KEYBOARD_RUNTIME_KEYS */ /** * Check for ghosting in the keyboard state. @@ -506,9 +508,11 @@ static int check_keys_changed(uint8_t *state) CPRINTF("]\n"); #endif +#ifdef CONFIG_KEYBOARD_RUNTIME_KEYS /* Swallow special keys */ if (check_runtime_keys(state)) return 0; +#endif #ifdef CONFIG_KEYBOARD_PROTOCOL_MKBP keyboard_fifo_add(state); diff --git a/include/config.h b/include/config.h index 817dc659f6..07c02acd5a 100644 --- a/include/config.h +++ b/include/config.h @@ -1515,6 +1515,12 @@ /* Print keyboard scan time intervals. */ #undef CONFIG_KEYBOARD_PRINT_SCAN_TIMES +/* + * Support for extra runtime key combinations (e.g. alt+volup+h/r for hibernate + * and warm reboot, respectively). + */ +#define CONFIG_KEYBOARD_RUNTIME_KEYS + /* * Call board-supplied keyboard_suppress_noise() function when the debounced * keyboard state changes. Some boards use this to send a signal to the audio