commit | 341564182474622e33c964e73a69ea8c1e004eb8 | [log] [tgz] |
---|---|---|
author | David Padlipsky <[email protected]> | Thu Jan 11 22:09:32 2024 |
committer | Chromium LUCI CQ <[email protected]> | Thu Jan 11 22:09:32 2024 |
tree | cdd040350f95cd1845dcc2d0dfdbb071deb48cc1 | |
parent | 18cb38b7d03e262ba0153e58d1ec974e4d4a3f58 [diff] [blame] |
customization: Allow button remapping for graphics tablet buttons Adds VKEY values for "button" key events so that these can be processed by Peripheral Customization. This will allow graphics tablet buttons to be fully customizable via Peripheral Customization. Bug: b/241965717 Change-Id: I7bcd70696b368504e9bef2818c02a07933177ab9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4998272 Reviewed-by: Scott Violet <[email protected]> Code-Coverage: [email protected] <[email protected]> Commit-Queue: David Padlipsky <[email protected]> Reviewed-by: Will Harris <[email protected]> Reviewed-by: Sean O'Brien <[email protected]> Cr-Commit-Position: refs/heads/main@{#1246102}
diff --git a/ash/events/peripheral_customization_event_rewriter.cc b/ash/events/peripheral_customization_event_rewriter.cc index 2086399d..d8cb61c63 100644 --- a/ash/events/peripheral_customization_event_rewriter.cc +++ b/ash/events/peripheral_customization_event_rewriter.cc
@@ -674,6 +674,11 @@ UpdatePressedButtonMap(std::move(button), key_event, rewritten_event); } + if (!rewritten_event && key_event.key_code() >= ui::VKEY_BUTTON_0 && + key_event.key_code() <= ui::VKEY_BUTTON_Z) { + return DiscardEvent(continuation); + } + if (!rewritten_event) { rewritten_event = std::make_unique<ui::KeyEvent>(key_event); }