diff options
author | Rajat Jain <rajatja@google.com> | 2020-04-15 16:56:32 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-21 21:32:52 +0000 |
commit | 4a585f797d11d8ac452eeb11050c33ecac29181a (patch) | |
tree | dbad1035b8c76a962a748b893b5c509692995edb /common/keyboard_scan.c | |
parent | 9ca749eb1a57a7e8c705ec0f11ab992d8394cc37 (diff) | |
download | chrome-ec-4a585f797d11d8ac452eeb11050c33ecac29181a.tar.gz |
common/vivaldi: Make the "Alt+VolUp+r" work on vivaldi keyboards
Since the VolUp button location can vary now, take that into account.
Signed-off-by: Rajat Jain <rajatja@google.com>
BUG=b:146501925,b:154167876
TEST=TEst Alt + VolUp + r on Jinlon
BRANCH=firmware-hatch-12672.B
Change-Id: I4dbc8692f6418fd786e5d33053e8c368cc5529ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2151854
Commit-Queue: Rajat Jain <rajatja@google.com>
Tested-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/keyboard_scan.c')
-rw-r--r-- | common/keyboard_scan.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index 6e79878ce7..5e147a1f46 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -344,6 +344,18 @@ static void read_matrix_id(uint8_t *id) #endif #ifdef CONFIG_KEYBOARD_RUNTIME_KEYS + +static uint8_t key_vol_up_row = KEYBOARD_DEFAULT_ROW_VOL_UP; +static uint8_t key_vol_up_col = KEYBOARD_DEFAULT_COL_VOL_UP; + +void set_vol_up_key(uint8_t row, uint8_t col) +{ + if (col < KEYBOARD_COLS_MAX && row < KEYBOARD_ROWS) { + key_vol_up_row = row; + key_vol_up_col = col; + } +} + /** * Check special runtime key combinations. * @@ -401,7 +413,7 @@ static int check_runtime_keys(const uint8_t *state) * All runtime key combos are (right or left ) alt + volume up + (some * key NOT on the same col as alt or volume up ) */ - if (state[KEYBOARD_COL_VOL_UP] != KEYBOARD_MASK_VOL_UP) + if (state[key_vol_up_col] != KEYBOARD_ROW_TO_MASK(key_vol_up_row)) return 0; if (state[KEYBOARD_COL_RIGHT_ALT] != KEYBOARD_MASK_RIGHT_ALT && |