| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 A JavaScript class that represents a sequence of keys entered | 6 * @fileoverview A JavaScript class that represents a sequence of keys entered |
| 7 * by the user. | 7 * by the user. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } else { | 62 } else { |
| 63 this.cvoxModifier = opt_cvoxModifier; | 63 this.cvoxModifier = opt_cvoxModifier; |
| 64 } | 64 } |
| 65 this.stickyMode = !!originalEvent['stickyMode']; | 65 this.stickyMode = !!originalEvent['stickyMode']; |
| 66 this.prefixKey = !!originalEvent['keyPrefix']; | 66 this.prefixKey = !!originalEvent['keyPrefix']; |
| 67 | 67 |
| 68 if (this.stickyMode && this.prefixKey) { | 68 if (this.stickyMode && this.prefixKey) { |
| 69 throw 'Prefix key and sticky mode cannot both be enabled: ' + originalEvent; | 69 throw 'Prefix key and sticky mode cannot both be enabled: ' + originalEvent; |
| 70 } | 70 } |
| 71 | 71 |
| 72 var event = this.resolveChromeOSSpecialKeys_(originalEvent); | 72 var event = originalEvent; |
| 73 | 73 |
| 74 // TODO (rshearer): We should take the user out of sticky mode if they | 74 // TODO (rshearer): We should take the user out of sticky mode if they |
| 75 // try to use the CVox modifier or prefix key. | 75 // try to use the CVox modifier or prefix key. |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Stores the key codes and modifiers for the keys in the key sequence. | 78 * Stores the key codes and modifiers for the keys in the key sequence. |
| 79 * TODO(rshearer): Consider making this structure an array of minimal | 79 * TODO(rshearer): Consider making this structure an array of minimal |
| 80 * keyEvent-like objects instead so we don't have to worry about what happens | 80 * keyEvent-like objects instead so we don't have to worry about what happens |
| 81 * when ctrlKey.length is different from altKey.length. | 81 * when ctrlKey.length is different from altKey.length. |
| 82 * | 82 * |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 break; | 640 break; |
| 641 case 122: // F11 | 641 case 122: // F11 |
| 642 evt['keyCode'] = 189; // Hyphen. | 642 evt['keyCode'] = 189; // Hyphen. |
| 643 break; | 643 break; |
| 644 case 123: // F12 | 644 case 123: // F12 |
| 645 evt['keyCode'] = 187; // Equals. | 645 evt['keyCode'] = 187; // Equals. |
| 646 break; | 646 break; |
| 647 } | 647 } |
| 648 return evt; | 648 return evt; |
| 649 }; | 649 }; |
| OLD | NEW |