Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5742)

Unified Diff: chrome/browser/resources/chromeos/switch_access/keyboard_handler.js

Issue 2905373002: Set keys for SwitchAccessEventHandler to capture using accessibiltyPrivate API (Closed)
Patch Set: Responded to comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
diff --git a/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js b/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
index 901690f594341130f35ad6a27d4705825c56683c..7231a6b6dc21641371c1d8709cff4c6de7828ff8 100644
--- a/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
+++ b/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
@@ -28,6 +28,10 @@ KeyboardHandler.prototype = {
* @private
*/
init_: function() {
+ // Capture keycodes for keys 1 through 4, and 6 through 9.
+ let keyCodes = ['1', '2', '3', '4', '6', '7', '8', '9'].map(
+ key => key.charCodeAt(0));
+ chrome.accessibilityPrivate.setSwitchAccessKeys(keyCodes);
document.addEventListener('keyup', this.handleKeyEvent_.bind(this));
},

Powered by Google App Engine
This is Rietveld 408576698