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

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: Updated extension histograms 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 8d9b1511c4f89fa639f9347cf03d683b56d608cf..eb407b524a4a8804ff073e16671044046b66cefb 100644
--- a/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
+++ b/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
@@ -28,6 +28,9 @@ KeyboardHandler.prototype = {
* @private
*/
init_: function() {
+ // Capture keycodes for keys 1 through 4, and 6 through 9.
+ chrome.accessibilityPrivate.setSwitchAccessKeys(
+ [49, 50, 51, 52, 54, 55, 56, 57]);
David Tseng 2017/05/26 22:10:31 Use ''.charCodeAt rather than hard coding the key
elichtenberg 2017/05/27 00:13:04 Done.
document.addEventListener('keyup', this.handleKeyEvent_.bind(this));
},

Powered by Google App Engine
This is Rietveld 408576698