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

Side by Side Diff: ui/keyboard/resources/elements/kb-keyset.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-keyset" attributes="nextKeyset isDefault" 7 <polymer-element name="kb-keyset" attributes="nextKeyset isDefault"
8 on-key-up="keyUp" on-key-longpress="keyLongpress"> 8 on-key-up="keyUp" on-key-longpress="keyLongpress">
9 <template> 9 <template>
10 <style> 10 <style>
11 @host { 11 @host {
12 * { 12 * {
13 -webkit-box-orient: vertical; 13 -webkit-box-orient: vertical;
14 -webkit-box-flex: 1; 14 -webkit-box-flex: 1;
15 display: -webkit-box; 15 display: -webkit-box;
16 } 16 }
17 } 17 }
18 </style> 18 </style>
19 <content select="kb-row"></content> 19 <content select="kb-row"></content>
20 <content select="kb-altkey-container" id="altkeyContainer" 20 <content select="kb-altkey-container" id="altkeyContainer"
21 touch-action="none"></content> 21 touch-action="none"></content>
22 <kb-altkey-data id="altkeyMetadata"></kb-altkey-data> 22 <kb-altkey-data id="altkeyMetadata"></kb-altkey-data>
23 </template> 23 </template>
24 <script> 24 <script>
25 Polymer('kb-keyset', { 25 Polymer('kb-keyset', {
26 isDefault: false, 26 isDefault: false,
27 nextKeyset: undefined, 27 nextKeyset: undefined,
28 // TODO(bshe): support select keyset on down, long and dbl events. 28 // TODO(bshe): support select keyset on down, long and dbl events.
29 keyUp: function(event, detail) { 29 keyUp: function(event, detail) {
30 switch (detail.char) {
31 case 'Shift':
32 case 'Alt':
33 case 'Ctrl':
34 return;
35 default:
36 break;
37 }
30 if (!detail.toKeyset) 38 if (!detail.toKeyset)
31 detail.toKeyset = this.nextKeyset; 39 detail.toKeyset = this.nextKeyset;
32 }, 40 },
33 keyLongpress: function(event, detail) { 41 keyLongpress: function(event, detail) {
34 if (!detail.char) 42 if (!detail.char)
35 return; 43 return;
36 44
37 var altkeyContainer = this.$.altkeyContainer.getDistributedNodes()[0]; 45 var altkeyContainer = this.$.altkeyContainer.getDistributedNodes()[0];
38 if (!altkeyContainer) 46 if (!altkeyContainer)
39 return; 47 return;
(...skipping 28 matching lines...) Expand all
68 var leftOffset = activeAltKeySet.offset * event.target.clientWidth; 76 var leftOffset = activeAltKeySet.offset * event.target.clientWidth;
69 activeAltKeySet.style.left = event.target.offsetLeft - leftOffset + 77 activeAltKeySet.style.left = event.target.offsetLeft - leftOffset +
70 'px'; 78 'px';
71 var nodes = activeAltKeySet.childNodes; 79 var nodes = activeAltKeySet.childNodes;
72 nodes[activeAltKeySet.offset].classList.add('active'); 80 nodes[activeAltKeySet.offset].classList.add('active');
73 altkeyContainer.hidden = false; 81 altkeyContainer.hidden = false;
74 } 82 }
75 }); 83 });
76 </script> 84 </script>
77 </polymer-element> 85 </polymer-element>
OLDNEW
« no previous file with comments | « ui/keyboard/resources/elements/kb-keyboard.html ('k') | ui/keyboard/resources/elements/kb-modifier-key.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698