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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/key_util.js

Issue 479323002: Fix broken ChromeVox keyboard shortcuts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Proper fix Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 collection of JavaScript utilities used to simplify working 6 * @fileoverview A collection of JavaScript utilities used to simplify working
7 * with keyboard events. 7 * with keyboard events.
8 */ 8 */
9 9
10 10
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 str = 'Cvox+' + str; 479 str = 'Cvox+' + str;
480 } else { 480 } else {
481 str = 'Cvox'; 481 str = 'Cvox';
482 } 482 }
483 } else if (keySequence.stickyMode) { 483 } else if (keySequence.stickyMode) {
484 if (str[str.length - 1] == '>') { 484 if (str[str.length - 1] == '>') {
485 str = str.slice(0, -1); 485 str = str.slice(0, -1);
486 } 486 }
487 str = str + '+' + str; 487 str = str + '+' + str;
488 } 488 }
489 console.error(str);
David Tseng 2014/08/19 18:24:04 Log spam?
dmazzoni 2014/08/19 19:59:26 Done.
489 return str; 490 return str;
490 }; 491 };
491 492
492 /** 493 /**
493 * Looks up if the given key sequence is triggered via double tap. 494 * Looks up if the given key sequence is triggered via double tap.
494 * @param {cvox.KeySequence} key The key. 495 * @param {cvox.KeySequence} key The key.
495 * @return {boolean} True if key is triggered via double tap. 496 * @return {boolean} True if key is triggered via double tap.
496 */ 497 */
497 cvox.KeyUtil.isDoubleTapKey = function(key) { 498 cvox.KeyUtil.isDoubleTapKey = function(key) {
498 var isSet = false; 499 var isSet = false;
499 var originalState = key.doubleTap; 500 var originalState = key.doubleTap;
500 key.doubleTap = true; 501 key.doubleTap = true;
501 for (var i = 0, keySeq; keySeq = cvox.KeySequence.doubleTapCache[i]; i++) { 502 for (var i = 0, keySeq; keySeq = cvox.KeySequence.doubleTapCache[i]; i++) {
502 if (keySeq.equals(key)) { 503 if (keySeq.equals(key)) {
503 isSet = true; 504 isSet = true;
504 break; 505 break;
505 } 506 }
506 } 507 }
507 key.doubleTap = originalState; 508 key.doubleTap = originalState;
508 return isSet; 509 return isSet;
509 }; 510 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698