Chromium Code Reviews| Index: ui/keyboard/resources/elements/kb-key.html |
| diff --git a/ui/keyboard/resources/elements/kb-key.html b/ui/keyboard/resources/elements/kb-key.html |
| index 75033967571603a62532c080254afcb564380718..7a7a1dbbfe42fc686433f8c8dae6f501fd1d02b0 100644 |
| --- a/ui/keyboard/resources/elements/kb-key.html |
| +++ b/ui/keyboard/resources/elements/kb-key.html |
| @@ -60,27 +60,50 @@ |
| <polymer-element name="kb-shift-key" attributes="unlockedCase lockedCase" |
| class="shift dark" char="Shift" extends="kb-key"> |
| <script> |
| - Polymer('kb-shift-key', { |
| - /** |
| - * Defines how capslock effects keyset transition. We always transition |
| - * from the unlockedCase to the lockedCase if capslock is on. |
| - * @type {string} |
| - */ |
| - unlockedCase: 'lower', |
| - lockedCase: 'upper', |
| - down: function(event) { |
| - this.super(); |
| - var detail = {}; |
| - if (this.keysetRules && this.keysetRules.dbl != undefined) { |
| - detail.char = this.char || this.textContent; |
| - detail.toKeyset = this.keysetRules.dbl[TO_KEYSET - OFFSET]; |
| - detail.nextKeyset = this.keysetRules.dbl[NEXT_KEYSET - OFFSET]; |
| - } |
| - this.fire('enable-dbl', detail); |
| - this.fire('enable-sel'); |
| - }, |
| - }); |
| + (function () { |
| + /** |
| + * Uses a closure to define one long press timer among all shift keys |
| + * regardless of the layout they are in. |
| + */ |
| + shiftLongPressTimer = undefined; |
|
bshe
2013/09/16 17:52:01
var shiftLongPressTimer = undefined
and @type {fun
rsadam
2013/09/16 18:23:49
Done.
|
| + |
| + Polymer('kb-shift-key', { |
| + /** |
| + * Defines how capslock effects keyset transition. We always transition |
| + * from the unlockedCase to the lockedCase if capslock is on. |
| + * @type {string} |
| + */ |
| + unlockedCase: 'lower', |
| + lockedCase: 'upper', |
| + control: true, |
| + |
| + down: function(event) { |
| + this.super(); |
| + var detail = {}; |
| + if (this.keysetRules && this.keysetRules.dbl != undefined) { |
| + detail.char = this.char || this.textContent; |
| + detail.toKeyset = this.keysetRules.dbl[TO_KEYSET - OFFSET]; |
| + detail.nextKeyset = this.keysetRules.dbl[NEXT_KEYSET - OFFSET]; |
| + } |
| + this.fire('enable-dbl', detail); |
| + this.fire('enable-sel'); |
| + }, |
| + |
| + /** |
| + * Overrides longPressTimer for the shift key. |
| + */ |
| + get longPressTimer() { |
| + return shiftLongPressTimer; |
| + }, |
| + |
| + set longPressTimer(timer) { |
| + shiftLongPressTimer = timer; |
| + }, |
| + }); |
| + |
|
bshe
2013/09/16 17:52:01
nit: remove the empty line and indent seems off ne
rsadam
2013/09/16 18:23:49
Done.
|
| + })(); |
| + |
| </script> |
| </polymer-element> |