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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 if (modifierKeyCombo.indexOf('Alt') != -1) { | 240 if (modifierKeyCombo.indexOf('Alt') != -1) { |
241 this.keys.altKey[index] = false; | 241 this.keys.altKey[index] = false; |
242 } | 242 } |
243 if (modifierKeyCombo.indexOf('Shift') != -1) { | 243 if (modifierKeyCombo.indexOf('Shift') != -1) { |
244 this.keys.shiftKey[index] = false; | 244 this.keys.shiftKey[index] = false; |
245 } | 245 } |
246 var metaKeyName = this.getMetaKeyName_(); | 246 var metaKeyName = this.getMetaKeyName_(); |
247 if (modifierKeyCombo.indexOf(metaKeyName) != -1) { | 247 if (modifierKeyCombo.indexOf(metaKeyName) != -1) { |
248 if (metaKeyName == 'Search') { | 248 if (metaKeyName == 'Search') { |
249 this.keys.searchKeyHeld[index] = false; | 249 this.keys.searchKeyHeld[index] = false; |
| 250 // TODO(dmazzoni): http://crbug.com/404763 Get rid of the code that |
| 251 // tracks the search key and just use meta everywhere. |
| 252 this.keys.metaKey[index] = false; |
250 } else if (metaKeyName == 'Cmd' || metaKeyName == 'Win') { | 253 } else if (metaKeyName == 'Cmd' || metaKeyName == 'Win') { |
251 this.keys.metaKey[index] = false; | 254 this.keys.metaKey[index] = false; |
252 } | 255 } |
253 } | 256 } |
254 }; | 257 }; |
255 | 258 |
256 | 259 |
257 /** | 260 /** |
258 * Get the user-facing name for the meta key (keyCode = 91), which varies | 261 * Get the user-facing name for the meta key (keyCode = 91), which varies |
259 * depending on the platform. | 262 * depending on the platform. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 break; | 621 break; |
619 case 122: // F11 | 622 case 122: // F11 |
620 evt['keyCode'] = 189; // Hyphen. | 623 evt['keyCode'] = 189; // Hyphen. |
621 break; | 624 break; |
622 case 123: // F12 | 625 case 123: // F12 |
623 evt['keyCode'] = 187; // Equals. | 626 evt['keyCode'] = 187; // Equals. |
624 break; | 627 break; |
625 } | 628 } |
626 return evt; | 629 return evt; |
627 }; | 630 }; |
OLD | NEW |