OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --> | 9 --> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 46: 'del', | 87 46: 'del', |
88 106: '*' | 88 106: '*' |
89 }; | 89 }; |
90 | 90 |
91 /** | 91 /** |
92 * MODIFIER_KEYS maps the short name for modifier keys used in a key | 92 * MODIFIER_KEYS maps the short name for modifier keys used in a key |
93 * combo string to the property name that references those same keys | 93 * combo string to the property name that references those same keys |
94 * in a KeyboardEvent instance. | 94 * in a KeyboardEvent instance. |
95 */ | 95 */ |
96 var MODIFIER_KEYS = { | 96 var MODIFIER_KEYS = { |
97 shift: 'shiftKey', | 97 'shift': 'shiftKey', |
98 ctrl: 'ctrlKey', | 98 'ctrl': 'ctrlKey', |
99 alt: 'altKey', | 99 'alt': 'altKey', |
100 meta: 'metaKey' | 100 'meta': 'metaKey' |
101 }; | 101 }; |
102 | 102 |
103 /** | 103 /** |
104 * KeyboardEvent.key is mostly represented by printable character made by | 104 * KeyboardEvent.key is mostly represented by printable character made by |
105 * the keyboard, with unprintable keys labeled nicely. | 105 * the keyboard, with unprintable keys labeled nicely. |
106 * | 106 * |
107 * However, on OS X, Alt+char can make a Unicode character that follows an | 107 * However, on OS X, Alt+char can make a Unicode character that follows an |
108 * Apple-specific mapping. In this case, we | 108 * Apple-specific mapping. In this case, we |
109 * fall back to .keyCode. | 109 * fall back to .keyCode. |
110 */ | 110 */ |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 var detail = Object.create(keyCombo); | 412 var detail = Object.create(keyCombo); |
413 detail.keyboardEvent = keyboardEvent; | 413 detail.keyboardEvent = keyboardEvent; |
414 | 414 |
415 this[handlerName].call(this, new CustomEvent(keyCombo.event, { | 415 this[handlerName].call(this, new CustomEvent(keyCombo.event, { |
416 detail: detail | 416 detail: detail |
417 })); | 417 })); |
418 } | 418 } |
419 }; | 419 }; |
420 })(); | 420 })(); |
421 </script> | 421 </script> |
OLD | NEW |