input: kbd_matrix: skip column with empty mask
The active key mask can be used for supporting multiple keyboard layouts with a single firmware. A possible use case is to support keyboard with or without a numpad, in which case an entire set of columns may be missing. Add a check to detect this condition and skip scanning that column entirely if no keys are defined in it. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
1261745b2c
commit
ad9f2c599b
1 changed files with 5 additions and 0 deletions
|
@ -88,6 +88,11 @@ static bool input_kbd_matrix_scan(const struct device *dev)
|
|||
kbd_row_t key_event = 0U;
|
||||
|
||||
for (int col = 0; col < cfg->col_size; col++) {
|
||||
if (cfg->actual_key_mask != NULL &&
|
||||
cfg->actual_key_mask[col] == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
input_kbd_matrix_drive_column(dev, col);
|
||||
|
||||
/* Allow the matrix to stabilize before reading it */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue