| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview ChromeVox keyboard handler. | 6 * @fileoverview ChromeVox keyboard handler. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('BackgroundKeyboardHandler'); | 9 goog.provide('BackgroundKeyboardHandler'); |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 onKeyDown: function(evt) { | 31 onKeyDown: function(evt) { |
| 32 evt.stickyMode = cvox.ChromeVox.isStickyModeOn() && cvox.ChromeVox.isActive; | 32 evt.stickyMode = cvox.ChromeVox.isStickyModeOn() && cvox.ChromeVox.isActive; |
| 33 if (cvox.ChromeVox.passThroughMode) | 33 if (cvox.ChromeVox.passThroughMode) |
| 34 return false; | 34 return false; |
| 35 | 35 |
| 36 if (ChromeVoxState.instance.mode != ChromeVoxMode.CLASSIC && | 36 if (ChromeVoxState.instance.mode != ChromeVoxMode.CLASSIC && |
| 37 !cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt)) { | 37 !cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt)) { |
| 38 evt.preventDefault(); | 38 evt.preventDefault(); |
| 39 evt.stopPropagation(); | 39 evt.stopPropagation(); |
| 40 } | 40 } |
| 41 Output.flushNextSpeechUtterance(); | 41 Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH); |
| 42 return false; | 42 return false; |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * Handles key up events. | 46 * Handles key up events. |
| 47 * @param {Event} evt The key down event to process. | 47 * @param {Event} evt The key down event to process. |
| 48 * @return {boolean} True if the default action should be performed. | 48 * @return {boolean} True if the default action should be performed. |
| 49 */ | 49 */ |
| 50 onKeyUp: function(evt) { | 50 onKeyUp: function(evt) { |
| 51 // Reset pass through mode once a keyup (not involving the pass through key) | 51 // Reset pass through mode once a keyup (not involving the pass through key) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (oldMode && | 85 if (oldMode && |
| 86 oldMode != ChromeVoxMode.CLASSIC && | 86 oldMode != ChromeVoxMode.CLASSIC && |
| 87 oldMode != ChromeVoxMode.COMPAT) { | 87 oldMode != ChromeVoxMode.COMPAT) { |
| 88 // The user's configured key map gets wiped here; this is consistent | 88 // The user's configured key map gets wiped here; this is consistent |
| 89 // with previous behavior when switching keymaps. | 89 // with previous behavior when switching keymaps. |
| 90 window['prefs'].switchToKeyMap('keymap_next'); | 90 window['prefs'].switchToKeyMap('keymap_next'); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 }; | 94 }; |
| OLD | NEW |