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 * The repeat delay in milliseconds before a key starts repeating. Use the | 6 * The repeat delay in milliseconds before a key starts repeating. Use the |
7 * same rate as Chromebook. | 7 * same rate as Chromebook. |
8 * (See chrome/browser/chromeos/language_preferences.cc) | 8 * (See chrome/browser/chromeos/language_preferences.cc) |
9 * @const | 9 * @const |
10 * @type {number} | 10 * @type {number} |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 // TODO (rsadam): This doesn't take into account index shifts caused | 417 // TODO (rsadam): This doesn't take into account index shifts caused |
418 // by vertical swipes. | 418 // by vertical swipes. |
419 if (detail.index % 2 != 0) { | 419 if (detail.index % 2 != 0) { |
420 modifiers |= Modifier.SHIFT; | 420 modifiers |= Modifier.SHIFT; |
421 modifiers |= Modifier.CONTROL; | 421 modifiers |= Modifier.CONTROL; |
422 } | 422 } |
423 MoveCursor(direction, modifiers); | 423 MoveCursor(direction, modifiers); |
424 return; | 424 return; |
425 } | 425 } |
426 // Triggers swipe hintText if it's a purely vertical swipe. | 426 // Triggers swipe hintText if it's a purely vertical swipe. |
427 if (!(direction & (SwipeDirection.LEFT | SwipeDirection.RIGHT))) { | 427 if (this.activeKeyset.flick && |
| 428 !(direction & (SwipeDirection.LEFT | SwipeDirection.RIGHT))) { |
428 // Check if event is relevant to us. | 429 // Check if event is relevant to us. |
429 if ((!detail.endSwipe) || (detail.isComplex)) | 430 if ((!detail.endSwipe) || (detail.isComplex)) |
430 return; | 431 return; |
431 // Too long a swipe. | 432 // Too long a swipe. |
432 var distance = Math.abs(detail.startEvent.screenY - | 433 var distance = Math.abs(detail.startEvent.screenY - |
433 detail.currentEvent.screenY); | 434 detail.currentEvent.screenY); |
434 if (distance > MAX_SWIPE_FLICK_DIST) | 435 if (distance > MAX_SWIPE_FLICK_DIST) |
435 return; | 436 return; |
436 var triggerKey = detail.startEvent.target; | 437 var triggerKey = detail.startEvent.target; |
437 if (triggerKey && triggerKey.onFlick) | 438 if (triggerKey && triggerKey.onFlick) |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 keyboardLoaded(); | 968 keyboardLoaded(); |
968 return true; | 969 return true; |
969 } | 970 } |
970 } | 971 } |
971 } | 972 } |
972 if (keysetsLoaded) | 973 if (keysetsLoaded) |
973 console.error('No default keyset found for ' + this.layout); | 974 console.error('No default keyset found for ' + this.layout); |
974 return false; | 975 return false; |
975 } | 976 } |
976 }); | 977 }); |
OLD | NEW |