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

Side by Side Diff: ui/keyboard/resources/elements/kb-modifier-key.html

Issue 46043004: Fixes modifier handling for repeat keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 <!-- 1 <!--
2 -- Copyright 2013 The Chromium Authors. All rights reserved. 2 -- Copyright 2013 The Chromium Authors. All rights reserved.
3 -- Use of this source code is governed by a BSD-style license that can be 3 -- Use of this source code is governed by a BSD-style license that can be
4 -- found in the LICENSE file. 4 -- found in the LICENSE file.
5 --> 5 -->
6 6
7 <polymer-element name="kb-modifier-key" class="unlocked dark" extends="kb-key"> 7 <polymer-element name="kb-modifier-key" class="unlocked dark" extends="kb-key">
8 <script> 8 <script>
9 (function () { 9 (function () {
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 /** 58 /**
59 * Returns whether the modifier for this key is active. 59 * Returns whether the modifier for this key is active.
60 * @return {boolean} 60 * @return {boolean}
61 */ 61 */
62 isActive: function() { 62 isActive: function() {
63 return this.state != KEY_STATES.UNLOCKED; 63 return this.state != KEY_STATES.UNLOCKED;
64 }, 64 },
65 65
66 /** 66 /**
67 * Notifies key that a non-control keyed up. 67 * Notifies key that a non-control keyed was typed.
68 * A control key is defined as one of shift, control or alt. 68 * A control key is defined as one of shift, control or alt.
69 */ 69 */
70 onNonControlKeyUp: function() { 70 onNonControlKeyTyped: function() {
71 switch(this.state) { 71 switch(this.state) {
72 case (KEY_STATES.TAPPED): 72 case (KEY_STATES.TAPPED):
73 this.state = KEY_STATES.UNLOCKED; 73 this.state = KEY_STATES.UNLOCKED;
74 break; 74 break;
75 } 75 }
76 }, 76 },
77 77
78 populateDetails: function(caller) { 78 populateDetails: function(caller) {
79 var detail = this.super([caller]); 79 var detail = this.super([caller]);
80 if (this.state != KEY_STATES.UNLOCKED) 80 if (this.state != KEY_STATES.UNLOCKED)
(...skipping 18 matching lines...) Expand all
99 return states[this.innerText]; 99 return states[this.innerText];
100 }, 100 },
101 101
102 set state(value) { 102 set state(value) {
103 states[this.innerText] = value; 103 states[this.innerText] = value;
104 } 104 }
105 }); 105 });
106 })(); 106 })();
107 </script> 107 </script>
108 </polymer-element> 108 </polymer-element>
OLDNEW
« no previous file with comments | « ui/keyboard/resources/elements/kb-keyset.html ('k') | ui/keyboard/resources/elements/kb-shift-key.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698