OLD | NEW |
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-key" extends="kb-key-base" | 7 <polymer-element name="kb-key" extends="kb-key-base" |
8 attributes="keyCode shiftModifier weight"> | 8 attributes="keyCode shiftModifier weight"> |
9 <template> | 9 <template> |
10 <style> | 10 <style> |
(...skipping 21 matching lines...) Expand all Loading... |
32 /** | 32 /** |
33 * Whether the shift key is pressed when producing the key value. | 33 * Whether the shift key is pressed when producing the key value. |
34 * @type {boolean} | 34 * @type {boolean} |
35 */ | 35 */ |
36 shiftModifier: false, | 36 shiftModifier: false, |
37 /** | 37 /** |
38 * Weighting to use for layout in order to properly size the key. | 38 * Weighting to use for layout in order to properly size the key. |
39 * Keys with a high weighting are wider than normal keys. | 39 * Keys with a high weighting are wider than normal keys. |
40 * @type {number} | 40 * @type {number} |
41 */ | 41 */ |
42 weight: 1 | 42 weight: 1, |
| 43 |
| 44 /** |
| 45 * Returns a subset of the key attributes. |
| 46 * @return {Object} Mapping of attributes for the key element. |
| 47 */ |
| 48 PopulateDetails: function() { |
| 49 var details = this.super(); |
| 50 details.keyCode = this.keyCode; |
| 51 details.shiftModifier = this.shiftModifier; |
| 52 return details; |
| 53 }, |
43 }); | 54 }); |
44 </script> | 55 </script> |
45 </polymer-element> | 56 </polymer-element> |
46 | 57 |
47 <!-- Special keys --> | 58 <!-- Special keys --> |
48 | 59 |
49 <polymer-element name="kb-shift-key" class="shift dark" char="Shift" | 60 <polymer-element name="kb-shift-key" class="shift dark" char="Shift" |
50 extends="kb-key"> | 61 extends="kb-key"> |
51 <script> | 62 <script> |
52 Polymer('kb-shift-key', { | 63 Polymer('kb-shift-key', { |
53 down: function(event) { | 64 down: function(event) { |
54 this.super(); | 65 this.super(); |
55 var detail = {}; | 66 var detail = {}; |
56 if (this.keysetRules && this.keysetRules.dbl != undefined) { | 67 if (this.keysetRules && this.keysetRules.dbl != undefined) { |
57 detail.char = this.char || this.textContent; | 68 detail.char = this.char || this.textContent; |
58 detail.toKeyset = this.keysetRules.dbl[TO_KEYSET - OFFSET]; | 69 detail.toKeyset = this.keysetRules.dbl[TO_KEYSET - OFFSET]; |
59 detail.nextKeyset = this.keysetRules.dbl[NEXT_KEYSET - OFFSET]; | 70 detail.nextKeyset = this.keysetRules.dbl[NEXT_KEYSET - OFFSET]; |
60 } | 71 } |
61 this.fire('enable-dbl', detail); | 72 this.fire('enable-dbl', detail); |
62 this.fire('enable-sel'); | 73 this.fire('enable-sel'); |
63 } | 74 }, |
64 }); | 75 }); |
65 </script> | 76 </script> |
66 </polymer-element> | 77 </polymer-element> |
67 | 78 |
68 <!-- | 79 <!-- |
69 -- TODO(kevers): Display popup menu for selecting layout on keypress. Display | 80 -- TODO(kevers): Display popup menu for selecting layout on keypress. Display |
70 -- code for keyboard layout in place of image. | 81 -- code for keyboard layout in place of image. |
71 --> | 82 --> |
72 <polymer-element name="kb-layout-selector" class="layout-selector dark" char="In
valid" | 83 <polymer-element name="kb-layout-selector" class="layout-selector dark" char="In
valid" |
73 extends="kb-key"> | 84 extends="kb-key"> |
74 <script> | 85 <script> |
75 Polymer('kb-layout-selector', { | 86 Polymer('kb-layout-selector', { |
76 toLayout: 'qwerty' | 87 toLayout: 'qwerty' |
77 }); | 88 }); |
78 </script> | 89 </script> |
79 </polymer-element> | 90 </polymer-element> |
OLD | NEW |