From 02158c8c190ae32d55ae64074bd8068bd17a0812 Mon Sep 17 00:00:00 2001 From: dtseng Date: Fri, 18 Mar 2016 11:50:52 -0700 Subject: [PATCH] Disable sticky key while in panel. It doesn't make sense to intercept ordinary commands while in the panel; this will help with the i-search experience and the possibility of implementing type to find commands. Also, rebind i-search to search+ctrl+f (without sticky) and ctrl+f (with sticky). This change is needed because we don't eat key events containing ctrl only without sticky mode on. Ctrl+F causes both regular find and ChromeVox find to pop up (without sticky mode). TEST=with sticky mode on, use i-search and menus. Do the same without sticky key. Observe sticky key gets retained (state) when exiting and gets turned off while in panel. Review URL: https://codereview.chromium.org/1819433002 Cr-Commit-Position: refs/heads/master@{#382033} --- .../chromevox/background/keymaps/next_keymap.json | 1 + .../chromeos/chromevox/cvox2/background/panel.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json index cfcd018dbe4034..5df5d3edc5069b 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json @@ -496,6 +496,7 @@ { "command": "toggleSearchWidget", "sequence": { + "cvoxModifier": true, "keys": { "keyCode": [70], "ctrlKey": [true] diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js index a8721e0d34c633..8405ba9e34be89 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js @@ -550,3 +550,12 @@ Panel.closeMenusAndRestoreFocus = function() { window.addEventListener('load', function() { Panel.init(); }, false); + +window.addEventListener('hashchange', function() { + if (location.hash == '#fullscreen' || location.hash == '#focus') { + this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn; + cvox.ChromeVox.isStickyPrefOn = false; + } else { + cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_; + } +}, false);