kea-rails 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kea-rails/version.rb +1 -1
  3. data/vendor/assets/components/Keypress/LICENSE +191 -0
  4. data/vendor/assets/components/Keypress/README.md +78 -0
  5. data/vendor/assets/components/Keypress/bower.json +28 -0
  6. data/vendor/assets/components/Keypress/keypress-2.1.0.min.js +33 -0
  7. data/vendor/assets/components/Keypress/keypress.coffee +921 -0
  8. data/vendor/assets/components/Keypress/keypress.js +1132 -0
  9. data/vendor/assets/components/Keypress/package.json +15 -0
  10. data/vendor/assets/components/attachejs/attache-jquery.js +47 -0
  11. data/vendor/assets/components/attachejs/attache-knockout.js +56 -0
  12. data/vendor/assets/components/attachejs/attache.css +10 -0
  13. data/vendor/assets/components/attachejs/attache.js +589 -0
  14. data/vendor/assets/components/attachejs/bower.json +36 -0
  15. data/vendor/assets/components/humane-js/bower.json +8 -0
  16. data/vendor/assets/components/humane-js/changelog.md +165 -0
  17. data/vendor/assets/components/humane-js/humane.js +238 -0
  18. data/vendor/assets/components/humane-js/humane.min.js +11 -0
  19. data/vendor/assets/components/humane-js/index.html +190 -0
  20. data/vendor/assets/components/humane-js/package.json +25 -0
  21. data/vendor/assets/components/humane-js/readme.md +85 -0
  22. data/vendor/assets/components/humane-js/test/issue23.html +11 -0
  23. data/vendor/assets/components/humane-js/test/issue36.html +9 -0
  24. data/vendor/assets/components/humane-js/test/issue38.html +15 -0
  25. data/vendor/assets/components/humane-js/test/issue49.html +9 -0
  26. data/vendor/assets/components/humane-js/theme-src/bigbox.styl +65 -0
  27. data/vendor/assets/components/humane-js/theme-src/boldlight.styl +64 -0
  28. data/vendor/assets/components/humane-js/theme-src/jackedup.styl +69 -0
  29. data/vendor/assets/components/humane-js/theme-src/libnotify.styl +61 -0
  30. data/vendor/assets/components/humane-js/theme-src/original.styl +51 -0
  31. data/vendor/assets/components/humane-js/themes/bigbox.css +123 -0
  32. data/vendor/assets/components/humane-js/themes/boldlight.css +122 -0
  33. data/vendor/assets/components/humane-js/themes/flatty.css +94 -0
  34. data/vendor/assets/components/humane-js/themes/jackedup.css +123 -0
  35. data/vendor/assets/components/humane-js/themes/libnotify.css +115 -0
  36. data/vendor/assets/components/humane-js/themes/original.css +72 -0
  37. data/vendor/assets/components/knockout-sortable/README.md +129 -0
  38. data/vendor/assets/components/knockout-sortable/bower.json +15 -0
  39. data/vendor/assets/components/knockout-sortable/build/knockout-sortable.js +358 -0
  40. data/vendor/assets/components/knockout-sortable/build/knockout-sortable.min.js +2 -0
  41. data/vendor/assets/components/uri.js/README.md +437 -0
  42. data/vendor/assets/components/uri.js/URI.jquery.json +38 -0
  43. data/vendor/assets/components/uri.js/about-uris.html +156 -0
  44. data/vendor/assets/components/uri.js/build.html +66 -0
  45. data/vendor/assets/components/uri.js/build.js +78 -0
  46. data/vendor/assets/components/uri.js/component.json +15 -0
  47. data/vendor/assets/components/uri.js/contribute.md +11 -0
  48. data/vendor/assets/components/uri.js/docs.html +1280 -0
  49. data/vendor/assets/components/uri.js/index.html +173 -0
  50. data/vendor/assets/components/uri.js/jquery-1.10.2.min.js +6 -0
  51. data/vendor/assets/components/uri.js/jquery-1.7.2.min.js +4 -0
  52. data/vendor/assets/components/uri.js/jquery-1.8.2.min.js +2 -0
  53. data/vendor/assets/components/uri.js/jquery-1.9.1.min.js +5 -0
  54. data/vendor/assets/components/uri.js/jquery-uri-plugin.html +203 -0
  55. data/vendor/assets/components/uri.js/package.json +75 -0
  56. data/vendor/assets/components/uri.js/prettify/lang-apollo.js +2 -0
  57. data/vendor/assets/components/uri.js/prettify/lang-clj.js +18 -0
  58. data/vendor/assets/components/uri.js/prettify/lang-css.js +2 -0
  59. data/vendor/assets/components/uri.js/prettify/lang-go.js +1 -0
  60. data/vendor/assets/components/uri.js/prettify/lang-hs.js +2 -0
  61. data/vendor/assets/components/uri.js/prettify/lang-lisp.js +3 -0
  62. data/vendor/assets/components/uri.js/prettify/lang-lua.js +2 -0
  63. data/vendor/assets/components/uri.js/prettify/lang-ml.js +2 -0
  64. data/vendor/assets/components/uri.js/prettify/lang-n.js +4 -0
  65. data/vendor/assets/components/uri.js/prettify/lang-proto.js +1 -0
  66. data/vendor/assets/components/uri.js/prettify/lang-scala.js +2 -0
  67. data/vendor/assets/components/uri.js/prettify/lang-sql.js +2 -0
  68. data/vendor/assets/components/uri.js/prettify/lang-tex.js +1 -0
  69. data/vendor/assets/components/uri.js/prettify/lang-vb.js +2 -0
  70. data/vendor/assets/components/uri.js/prettify/lang-vhdl.js +3 -0
  71. data/vendor/assets/components/uri.js/prettify/lang-wiki.js +2 -0
  72. data/vendor/assets/components/uri.js/prettify/lang-xq.js +3 -0
  73. data/vendor/assets/components/uri.js/prettify/lang-yaml.js +2 -0
  74. data/vendor/assets/components/uri.js/prettify/prettify.css +1 -0
  75. data/vendor/assets/components/uri.js/prettify/prettify.js +28 -0
  76. data/vendor/assets/components/uri.js/prettify/prettify.sunburst.css +52 -0
  77. data/vendor/assets/components/uri.js/screen.css +167 -0
  78. data/vendor/assets/components/uri.js/screen.js +39 -0
  79. data/vendor/assets/components/uri.js/src/IPv6.js +185 -0
  80. data/vendor/assets/components/uri.js/src/SecondLevelDomains.js +220 -0
  81. data/vendor/assets/components/uri.js/src/URI.fragmentQuery.js +103 -0
  82. data/vendor/assets/components/uri.js/src/URI.fragmentURI.js +96 -0
  83. data/vendor/assets/components/uri.js/src/URI.js +1938 -0
  84. data/vendor/assets/components/uri.js/src/URI.min.js +81 -0
  85. data/vendor/assets/components/uri.js/src/URITemplate.js +494 -0
  86. data/vendor/assets/components/uri.js/src/jquery.URI.js +232 -0
  87. data/vendor/assets/components/uri.js/src/jquery.URI.min.js +7 -0
  88. data/vendor/assets/components/uri.js/src/punycode.js +508 -0
  89. data/vendor/assets/components/uri.js/test/index.html +26 -0
  90. data/vendor/assets/components/uri.js/test/pre_libs.js +4 -0
  91. data/vendor/assets/components/uri.js/test/qunit/qunit-composite.css +13 -0
  92. data/vendor/assets/components/uri.js/test/qunit/qunit-composite.js +167 -0
  93. data/vendor/assets/components/uri.js/test/qunit/qunit.css +244 -0
  94. data/vendor/assets/components/uri.js/test/qunit/qunit.js +2212 -0
  95. data/vendor/assets/components/uri.js/test/test.URI.html +26 -0
  96. data/vendor/assets/components/uri.js/test/test.fragmentQuery.html +31 -0
  97. data/vendor/assets/components/uri.js/test/test.fragmentURI.html +31 -0
  98. data/vendor/assets/components/uri.js/test/test.jQuery-1.10.html +31 -0
  99. data/vendor/assets/components/uri.js/test/test.jQuery-1.7.html +31 -0
  100. data/vendor/assets/components/uri.js/test/test.jQuery-1.8.html +31 -0
  101. data/vendor/assets/components/uri.js/test/test.jQuery-1.9.html +31 -0
  102. data/vendor/assets/components/uri.js/test/test.js +1409 -0
  103. data/vendor/assets/components/uri.js/test/test_fragmentQuery.js +57 -0
  104. data/vendor/assets/components/uri.js/test/test_fragmentURI.js +59 -0
  105. data/vendor/assets/components/uri.js/test/test_jim.js +143 -0
  106. data/vendor/assets/components/uri.js/test/test_jquery.js +138 -0
  107. data/vendor/assets/components/uri.js/test/test_template.js +385 -0
  108. data/vendor/assets/components/uri.js/test/urls.js +1236 -0
  109. data/vendor/assets/components/uri.js/uri-template.html +234 -0
  110. data/vendor/assets/components/uri.js/utils/SLDs.php +37 -0
  111. data/vendor/assets/components/uri.js/utils/sld.js +101 -0
  112. data/vendor/assets/components/veiljs/bower.json +36 -0
  113. data/vendor/assets/components/veiljs/veil-jquery.js +47 -0
  114. data/vendor/assets/components/veiljs/veil-knockout.js +55 -0
  115. data/vendor/assets/components/veiljs/veil.js +465 -0
  116. data/vendor/assets/javascripts/fuse.js +472 -0
  117. data/vendor/assets/javascripts/jquery-ui.js +3844 -0
  118. data/vendor/assets/javascripts/knockout-3.2.0-debug.js +5299 -0
  119. data/vendor/assets/javascripts/moment.js +1902 -0
  120. data/vendor/assets/javascripts/pikaday.js +896 -0
  121. data/vendor/assets/stylesheets/pikaday.css +171 -0
  122. metadata +120 -1
@@ -0,0 +1,1132 @@
1
+ // Generated by CoffeeScript 1.8.0
2
+
3
+ /*
4
+ Copyright 2014 David Mauro
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+
18
+ Keypress is a robust keyboard input capturing Javascript utility
19
+ focused on input for games.
20
+
21
+ version 2.1.0
22
+ */
23
+
24
+
25
+ /*
26
+ Combo options available and their defaults:
27
+ keys : [] - An array of the keys pressed together to activate combo.
28
+ count : 0 - The number of times a counting combo has been pressed. Reset on release.
29
+ is_unordered : false - Unless this is set to true, the keys can be pressed down in any order.
30
+ is_counting : false - Makes this a counting combo (see documentation).
31
+ is_exclusive : false - This combo will replace other exclusive combos when true.
32
+ is_solitary : false - This combo will only fire if ONLY it's keys are pressed down.
33
+ is_sequence : false - Rather than a key combo, this is an ordered key sequence.
34
+ prevent_default : false - Prevent default behavior for all component key keypresses.
35
+ prevent_repeat : false - Prevent the combo from repeating when keydown is held.
36
+ on_keydown : null - A function that is called when the combo is pressed.
37
+ on_keyup : null - A function that is called when the combo is released.
38
+ on_release : null - A function that is called when all keys in the combo are released.
39
+ this : undefined - Defines the scope for your callback functions.
40
+ */
41
+
42
+ (function() {
43
+ var Combo, keypress, _change_keycodes_by_browser, _compare_arrays, _compare_arrays_sorted, _convert_key_to_readable, _convert_to_shifted_key, _decide_meta_key, _factory_defaults, _filter_array, _index_of_in_array, _is_array_in_array, _is_array_in_array_sorted, _key_is_valid, _keycode_alternate_names, _keycode_dictionary, _keycode_shifted_keys, _log_error, _metakey, _modifier_event_mapping, _modifier_keys, _validate_combo,
44
+ __hasProp = {}.hasOwnProperty,
45
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
46
+
47
+ _factory_defaults = {
48
+ is_unordered: false,
49
+ is_counting: false,
50
+ is_exclusive: false,
51
+ is_solitary: false,
52
+ prevent_default: false,
53
+ prevent_repeat: false
54
+ };
55
+
56
+ _modifier_keys = ["meta", "alt", "option", "ctrl", "shift", "cmd"];
57
+
58
+ _metakey = "ctrl";
59
+
60
+ keypress = {};
61
+
62
+ keypress.debug = false;
63
+
64
+ Combo = (function() {
65
+ function Combo(dictionary) {
66
+ var property, value;
67
+ for (property in dictionary) {
68
+ if (!__hasProp.call(dictionary, property)) continue;
69
+ value = dictionary[property];
70
+ if (value !== false) {
71
+ this[property] = value;
72
+ }
73
+ }
74
+ this.keys = this.keys || [];
75
+ this.count = this.count || 0;
76
+ }
77
+
78
+ Combo.prototype.allows_key_repeat = function() {
79
+ return !this.prevent_repeat && typeof this.on_keydown === "function";
80
+ };
81
+
82
+ Combo.prototype.reset = function() {
83
+ this.count = 0;
84
+ return this.keyup_fired = null;
85
+ };
86
+
87
+ return Combo;
88
+
89
+ })();
90
+
91
+ keypress.Listener = (function() {
92
+ function Listener(element, defaults) {
93
+ var attach_handler, property, value;
94
+ this.should_suppress_event_defaults = false;
95
+ this.should_force_event_defaults = false;
96
+ this.sequence_delay = 800;
97
+ this._registered_combos = [];
98
+ this._keys_down = [];
99
+ this._active_combos = [];
100
+ this._sequence = [];
101
+ this._sequence_timer = null;
102
+ this._prevent_capture = false;
103
+ this._defaults = defaults || {};
104
+ for (property in _factory_defaults) {
105
+ if (!__hasProp.call(_factory_defaults, property)) continue;
106
+ value = _factory_defaults[property];
107
+ this._defaults[property] = this._defaults[property] || value;
108
+ }
109
+ this.element = element || document.body;
110
+ attach_handler = function(target, event, handler) {
111
+ if (target.addEventListener) {
112
+ target.addEventListener(event, handler);
113
+ } else if (target.attachEvent) {
114
+ target.attachEvent("on" + event, handler);
115
+ }
116
+ return handler;
117
+ };
118
+ this.keydown_event = attach_handler(this.element, "keydown", (function(_this) {
119
+ return function(e) {
120
+ e = e || window.event;
121
+ _this._receive_input(e, true);
122
+ return _this._bug_catcher(e);
123
+ };
124
+ })(this));
125
+ this.keyup_event = attach_handler(this.element, "keyup", (function(_this) {
126
+ return function(e) {
127
+ e = e || window.event;
128
+ return _this._receive_input(e, false);
129
+ };
130
+ })(this));
131
+ this.blur_event = attach_handler(window, "blur", (function(_this) {
132
+ return function() {
133
+ var key, _i, _len, _ref;
134
+ _ref = _this._keys_down;
135
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
136
+ key = _ref[_i];
137
+ _this._key_up(key, {});
138
+ }
139
+ return _this._keys_down = [];
140
+ };
141
+ })(this));
142
+ }
143
+
144
+ Listener.prototype.destroy = function() {
145
+ var remove_handler;
146
+ remove_handler = function(target, event, handler) {
147
+ if (target.removeEventListener != null) {
148
+ return target.removeEventListener(event, handler);
149
+ } else if (target.removeEvent != null) {
150
+ return target.removeEvent("on" + event, handler);
151
+ }
152
+ };
153
+ remove_handler(this.element, "keydown", this.keydown_event);
154
+ remove_handler(this.element, "keyup", this.keyup_event);
155
+ return remove_handler(window, "blur", this.blur_event);
156
+ };
157
+
158
+ Listener.prototype._bug_catcher = function(e) {
159
+ var _ref;
160
+ if (_metakey === "cmd" && __indexOf.call(this._keys_down, "cmd") >= 0 && ((_ref = _convert_key_to_readable(e.keyCode)) !== "cmd" && _ref !== "shift" && _ref !== "alt" && _ref !== "caps" && _ref !== "tab")) {
161
+ return this._receive_input(e, false);
162
+ }
163
+ };
164
+
165
+ Listener.prototype._cmd_bug_check = function(combo_keys) {
166
+ if (_metakey === "cmd" && __indexOf.call(this._keys_down, "cmd") >= 0 && __indexOf.call(combo_keys, "cmd") < 0) {
167
+ return false;
168
+ }
169
+ return true;
170
+ };
171
+
172
+ Listener.prototype._prevent_default = function(e, should_prevent) {
173
+ if ((should_prevent || this.should_suppress_event_defaults) && !this.should_force_event_defaults) {
174
+ if (e.preventDefault) {
175
+ e.preventDefault();
176
+ } else {
177
+ e.returnValue = false;
178
+ }
179
+ if (e.stopPropagation) {
180
+ return e.stopPropagation();
181
+ }
182
+ }
183
+ };
184
+
185
+ Listener.prototype._get_active_combos = function(key) {
186
+ var active_combos, keys_down;
187
+ active_combos = [];
188
+ keys_down = _filter_array(this._keys_down, function(down_key) {
189
+ return down_key !== key;
190
+ });
191
+ keys_down.push(key);
192
+ this._match_combo_arrays(keys_down, (function(_this) {
193
+ return function(match) {
194
+ if (_this._cmd_bug_check(match.keys)) {
195
+ return active_combos.push(match);
196
+ }
197
+ };
198
+ })(this));
199
+ this._fuzzy_match_combo_arrays(keys_down, (function(_this) {
200
+ return function(match) {
201
+ if (__indexOf.call(active_combos, match) >= 0) {
202
+ return;
203
+ }
204
+ if (!(match.is_solitary || !_this._cmd_bug_check(match.keys))) {
205
+ return active_combos.push(match);
206
+ }
207
+ };
208
+ })(this));
209
+ return active_combos;
210
+ };
211
+
212
+ Listener.prototype._get_potential_combos = function(key) {
213
+ var combo, potentials, _i, _len, _ref;
214
+ potentials = [];
215
+ _ref = this._registered_combos;
216
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
217
+ combo = _ref[_i];
218
+ if (combo.is_sequence) {
219
+ continue;
220
+ }
221
+ if (__indexOf.call(combo.keys, key) >= 0 && this._cmd_bug_check(combo.keys)) {
222
+ potentials.push(combo);
223
+ }
224
+ }
225
+ return potentials;
226
+ };
227
+
228
+ Listener.prototype._add_to_active_combos = function(combo) {
229
+ var active_combo, active_key, active_keys, already_replaced, combo_key, i, should_prepend, should_replace, _i, _j, _k, _len, _len1, _ref, _ref1;
230
+ should_replace = false;
231
+ should_prepend = true;
232
+ already_replaced = false;
233
+ if (__indexOf.call(this._active_combos, combo) >= 0) {
234
+ return true;
235
+ } else if (this._active_combos.length) {
236
+ for (i = _i = 0, _ref = this._active_combos.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
237
+ active_combo = this._active_combos[i];
238
+ if (!(active_combo && active_combo.is_exclusive && combo.is_exclusive)) {
239
+ continue;
240
+ }
241
+ active_keys = active_combo.keys;
242
+ if (!should_replace) {
243
+ for (_j = 0, _len = active_keys.length; _j < _len; _j++) {
244
+ active_key = active_keys[_j];
245
+ should_replace = true;
246
+ if (__indexOf.call(combo.keys, active_key) < 0) {
247
+ should_replace = false;
248
+ break;
249
+ }
250
+ }
251
+ }
252
+ if (should_prepend && !should_replace) {
253
+ _ref1 = combo.keys;
254
+ for (_k = 0, _len1 = _ref1.length; _k < _len1; _k++) {
255
+ combo_key = _ref1[_k];
256
+ should_prepend = false;
257
+ if (__indexOf.call(active_keys, combo_key) < 0) {
258
+ should_prepend = true;
259
+ break;
260
+ }
261
+ }
262
+ }
263
+ if (should_replace) {
264
+ if (already_replaced) {
265
+ active_combo = this._active_combos.splice(i, 1)[0];
266
+ if (active_combo != null) {
267
+ active_combo.reset();
268
+ }
269
+ } else {
270
+ active_combo = this._active_combos.splice(i, 1, combo)[0];
271
+ if (active_combo != null) {
272
+ active_combo.reset();
273
+ }
274
+ already_replaced = true;
275
+ }
276
+ should_prepend = false;
277
+ }
278
+ }
279
+ }
280
+ if (should_prepend) {
281
+ this._active_combos.unshift(combo);
282
+ }
283
+ return should_replace || should_prepend;
284
+ };
285
+
286
+ Listener.prototype._remove_from_active_combos = function(combo) {
287
+ var active_combo, i, _i, _ref;
288
+ for (i = _i = 0, _ref = this._active_combos.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
289
+ active_combo = this._active_combos[i];
290
+ if (active_combo === combo) {
291
+ combo = this._active_combos.splice(i, 1)[0];
292
+ combo.reset();
293
+ break;
294
+ }
295
+ }
296
+ };
297
+
298
+ Listener.prototype._get_possible_sequences = function() {
299
+ var combo, i, j, match, matches, sequence, _i, _j, _k, _len, _ref, _ref1, _ref2;
300
+ matches = [];
301
+ _ref = this._registered_combos;
302
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
303
+ combo = _ref[_i];
304
+ for (j = _j = 1, _ref1 = this._sequence.length; 1 <= _ref1 ? _j <= _ref1 : _j >= _ref1; j = 1 <= _ref1 ? ++_j : --_j) {
305
+ sequence = this._sequence.slice(-j);
306
+ if (!combo.is_sequence) {
307
+ continue;
308
+ }
309
+ if (__indexOf.call(combo.keys, "shift") < 0) {
310
+ sequence = _filter_array(sequence, function(key) {
311
+ return key !== "shift";
312
+ });
313
+ if (!sequence.length) {
314
+ continue;
315
+ }
316
+ }
317
+ for (i = _k = 0, _ref2 = sequence.length; 0 <= _ref2 ? _k < _ref2 : _k > _ref2; i = 0 <= _ref2 ? ++_k : --_k) {
318
+ if (combo.keys[i] === sequence[i]) {
319
+ match = true;
320
+ } else {
321
+ match = false;
322
+ break;
323
+ }
324
+ }
325
+ if (match) {
326
+ matches.push(combo);
327
+ }
328
+ }
329
+ }
330
+ return matches;
331
+ };
332
+
333
+ Listener.prototype._add_key_to_sequence = function(key, e) {
334
+ var combo, sequence_combos, _i, _len;
335
+ this._sequence.push(key);
336
+ sequence_combos = this._get_possible_sequences();
337
+ if (sequence_combos.length) {
338
+ for (_i = 0, _len = sequence_combos.length; _i < _len; _i++) {
339
+ combo = sequence_combos[_i];
340
+ this._prevent_default(e, combo.prevent_default);
341
+ }
342
+ if (this._sequence_timer) {
343
+ clearTimeout(this._sequence_timer);
344
+ }
345
+ if (this.sequence_delay > -1) {
346
+ this._sequence_timer = setTimeout(function() {
347
+ return this._sequence = [];
348
+ }, this.sequence_delay);
349
+ }
350
+ } else {
351
+ this._sequence = [];
352
+ }
353
+ };
354
+
355
+ Listener.prototype._get_sequence = function(key) {
356
+ var combo, i, j, match, seq_key, sequence, _i, _j, _k, _len, _ref, _ref1, _ref2;
357
+ _ref = this._registered_combos;
358
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
359
+ combo = _ref[_i];
360
+ if (!combo.is_sequence) {
361
+ continue;
362
+ }
363
+ for (j = _j = 1, _ref1 = this._sequence.length; 1 <= _ref1 ? _j <= _ref1 : _j >= _ref1; j = 1 <= _ref1 ? ++_j : --_j) {
364
+ sequence = (_filter_array(this._sequence, function(seq_key) {
365
+ if (__indexOf.call(combo.keys, "shift") >= 0) {
366
+ return true;
367
+ }
368
+ return seq_key !== "shift";
369
+ })).slice(-j);
370
+ if (combo.keys.length !== sequence.length) {
371
+ continue;
372
+ }
373
+ for (i = _k = 0, _ref2 = sequence.length; 0 <= _ref2 ? _k < _ref2 : _k > _ref2; i = 0 <= _ref2 ? ++_k : --_k) {
374
+ seq_key = sequence[i];
375
+ if (__indexOf.call(combo.keys, "shift") < 0) {
376
+ if (seq_key === "shift") {
377
+ continue;
378
+ }
379
+ }
380
+ if (key === "shift" && __indexOf.call(combo.keys, "shift") < 0) {
381
+ continue;
382
+ }
383
+ if (combo.keys[i] === seq_key) {
384
+ match = true;
385
+ } else {
386
+ match = false;
387
+ break;
388
+ }
389
+ }
390
+ }
391
+ if (match) {
392
+ return combo;
393
+ }
394
+ }
395
+ return false;
396
+ };
397
+
398
+ Listener.prototype._receive_input = function(e, is_keydown) {
399
+ var key;
400
+ if (this._prevent_capture) {
401
+ if (this._keys_down.length) {
402
+ this._keys_down = [];
403
+ }
404
+ return;
405
+ }
406
+ key = _convert_key_to_readable(e.keyCode);
407
+ if (!is_keydown && !this._keys_down.length && (key === "alt" || key === _metakey)) {
408
+ return;
409
+ }
410
+ if (!key) {
411
+ return;
412
+ }
413
+ if (is_keydown) {
414
+ return this._key_down(key, e);
415
+ } else {
416
+ return this._key_up(key, e);
417
+ }
418
+ };
419
+
420
+ Listener.prototype._fire = function(event, combo, key_event, is_autorepeat) {
421
+ if (typeof combo["on_" + event] === "function") {
422
+ this._prevent_default(key_event, combo["on_" + event].call(combo["this"], key_event, combo.count, is_autorepeat) !== true);
423
+ }
424
+ if (event === "release") {
425
+ combo.count = 0;
426
+ }
427
+ if (event === "keyup") {
428
+ return combo.keyup_fired = true;
429
+ }
430
+ };
431
+
432
+ Listener.prototype._match_combo_arrays = function(potential_match, match_handler) {
433
+ var source_combo, _i, _len, _ref;
434
+ _ref = this._registered_combos;
435
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
436
+ source_combo = _ref[_i];
437
+ if ((!source_combo.is_unordered && _compare_arrays_sorted(potential_match, source_combo.keys)) || (source_combo.is_unordered && _compare_arrays(potential_match, source_combo.keys))) {
438
+ match_handler(source_combo);
439
+ }
440
+ }
441
+ };
442
+
443
+ Listener.prototype._fuzzy_match_combo_arrays = function(potential_match, match_handler) {
444
+ var source_combo, _i, _len, _ref;
445
+ _ref = this._registered_combos;
446
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
447
+ source_combo = _ref[_i];
448
+ if ((!source_combo.is_unordered && _is_array_in_array_sorted(source_combo.keys, potential_match)) || (source_combo.is_unordered && _is_array_in_array(source_combo.keys, potential_match))) {
449
+ match_handler(source_combo);
450
+ }
451
+ }
452
+ };
453
+
454
+ Listener.prototype._keys_remain = function(combo) {
455
+ var key, keys_remain, _i, _len, _ref;
456
+ _ref = combo.keys;
457
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
458
+ key = _ref[_i];
459
+ if (__indexOf.call(this._keys_down, key) >= 0) {
460
+ keys_remain = true;
461
+ break;
462
+ }
463
+ }
464
+ return keys_remain;
465
+ };
466
+
467
+ Listener.prototype._key_down = function(key, e) {
468
+ var combo, combos, event_mod, i, mod, potential, potential_combos, sequence_combo, shifted_key, _i, _j, _k, _len, _len1, _ref;
469
+ shifted_key = _convert_to_shifted_key(key, e);
470
+ if (shifted_key) {
471
+ key = shifted_key;
472
+ }
473
+ this._add_key_to_sequence(key, e);
474
+ sequence_combo = this._get_sequence(key);
475
+ if (sequence_combo) {
476
+ this._fire("keydown", sequence_combo, e);
477
+ }
478
+ for (mod in _modifier_event_mapping) {
479
+ event_mod = _modifier_event_mapping[mod];
480
+ if (!e[event_mod]) {
481
+ continue;
482
+ }
483
+ if (mod === key || __indexOf.call(this._keys_down, mod) >= 0) {
484
+ continue;
485
+ }
486
+ this._keys_down.push(mod);
487
+ }
488
+ for (mod in _modifier_event_mapping) {
489
+ event_mod = _modifier_event_mapping[mod];
490
+ if (mod === key) {
491
+ continue;
492
+ }
493
+ if (__indexOf.call(this._keys_down, mod) >= 0 && !e[event_mod]) {
494
+ if (mod === "cmd" && _metakey !== "cmd") {
495
+ continue;
496
+ }
497
+ for (i = _i = 0, _ref = this._keys_down.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
498
+ if (this._keys_down[i] === mod) {
499
+ this._keys_down.splice(i, 1);
500
+ }
501
+ }
502
+ }
503
+ }
504
+ combos = this._get_active_combos(key);
505
+ potential_combos = this._get_potential_combos(key);
506
+ for (_j = 0, _len = combos.length; _j < _len; _j++) {
507
+ combo = combos[_j];
508
+ this._handle_combo_down(combo, potential_combos, key, e);
509
+ }
510
+ if (potential_combos.length) {
511
+ for (_k = 0, _len1 = potential_combos.length; _k < _len1; _k++) {
512
+ potential = potential_combos[_k];
513
+ this._prevent_default(e, potential.prevent_default);
514
+ }
515
+ }
516
+ if (__indexOf.call(this._keys_down, key) < 0) {
517
+ this._keys_down.push(key);
518
+ }
519
+ };
520
+
521
+ Listener.prototype._handle_combo_down = function(combo, potential_combos, key, e) {
522
+ var is_autorepeat, is_other_exclusive, potential_combo, result, _i, _len;
523
+ if (__indexOf.call(combo.keys, key) < 0) {
524
+ return false;
525
+ }
526
+ this._prevent_default(e, combo && combo.prevent_default);
527
+ is_autorepeat = false;
528
+ if (__indexOf.call(this._keys_down, key) >= 0) {
529
+ is_autorepeat = true;
530
+ if (!combo.allows_key_repeat()) {
531
+ return false;
532
+ }
533
+ }
534
+ result = this._add_to_active_combos(combo, key);
535
+ combo.keyup_fired = false;
536
+ is_other_exclusive = false;
537
+ if (combo.is_exclusive) {
538
+ for (_i = 0, _len = potential_combos.length; _i < _len; _i++) {
539
+ potential_combo = potential_combos[_i];
540
+ if (potential_combo.is_exclusive && potential_combo.keys.length > combo.keys.length) {
541
+ is_other_exclusive = true;
542
+ break;
543
+ }
544
+ }
545
+ }
546
+ if (!is_other_exclusive) {
547
+ if (combo.is_counting && typeof combo.on_keydown === "function") {
548
+ combo.count += 1;
549
+ }
550
+ if (result) {
551
+ return this._fire("keydown", combo, e, is_autorepeat);
552
+ }
553
+ }
554
+ };
555
+
556
+ Listener.prototype._key_up = function(key, e) {
557
+ var active_combo, active_combos_length, combo, combos, i, sequence_combo, shifted_key, unshifted_key, _i, _j, _k, _l, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
558
+ unshifted_key = key;
559
+ shifted_key = _convert_to_shifted_key(key, e);
560
+ if (shifted_key) {
561
+ key = shifted_key;
562
+ }
563
+ shifted_key = _keycode_shifted_keys[unshifted_key];
564
+ if (e.shiftKey) {
565
+ if (!(shifted_key && __indexOf.call(this._keys_down, shifted_key) >= 0)) {
566
+ key = unshifted_key;
567
+ }
568
+ } else {
569
+ if (!(unshifted_key && __indexOf.call(this._keys_down, unshifted_key) >= 0)) {
570
+ key = shifted_key;
571
+ }
572
+ }
573
+ sequence_combo = this._get_sequence(key);
574
+ if (sequence_combo) {
575
+ this._fire("keyup", sequence_combo, e);
576
+ }
577
+ if (__indexOf.call(this._keys_down, key) < 0) {
578
+ return false;
579
+ }
580
+ for (i = _i = 0, _ref = this._keys_down.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
581
+ if ((_ref1 = this._keys_down[i]) === key || _ref1 === shifted_key || _ref1 === unshifted_key) {
582
+ this._keys_down.splice(i, 1);
583
+ break;
584
+ }
585
+ }
586
+ active_combos_length = this._active_combos.length;
587
+ combos = [];
588
+ _ref2 = this._active_combos;
589
+ for (_j = 0, _len = _ref2.length; _j < _len; _j++) {
590
+ active_combo = _ref2[_j];
591
+ if (__indexOf.call(active_combo.keys, key) >= 0) {
592
+ combos.push(active_combo);
593
+ }
594
+ }
595
+ for (_k = 0, _len1 = combos.length; _k < _len1; _k++) {
596
+ combo = combos[_k];
597
+ this._handle_combo_up(combo, e, key);
598
+ }
599
+ if (active_combos_length > 1) {
600
+ _ref3 = this._active_combos;
601
+ for (_l = 0, _len2 = _ref3.length; _l < _len2; _l++) {
602
+ active_combo = _ref3[_l];
603
+ if (active_combo === void 0 || __indexOf.call(combos, active_combo) >= 0) {
604
+ continue;
605
+ }
606
+ if (!this._keys_remain(active_combo)) {
607
+ this._remove_from_active_combos(active_combo);
608
+ }
609
+ }
610
+ }
611
+ };
612
+
613
+ Listener.prototype._handle_combo_up = function(combo, e, key) {
614
+ var keys_down, keys_remaining;
615
+ this._prevent_default(e, combo && combo.prevent_default);
616
+ keys_remaining = this._keys_remain(combo);
617
+ if (!combo.keyup_fired) {
618
+ keys_down = this._keys_down.slice();
619
+ keys_down.push(key);
620
+ if (!combo.is_solitary || _compare_arrays(keys_down, combo.keys)) {
621
+ this._fire("keyup", combo, e);
622
+ if (combo.is_counting && typeof combo.on_keyup === "function" && typeof combo.on_keydown !== "function") {
623
+ combo.count += 1;
624
+ }
625
+ }
626
+ }
627
+ if (!keys_remaining) {
628
+ this._fire("release", combo, e);
629
+ this._remove_from_active_combos(combo);
630
+ }
631
+ };
632
+
633
+ Listener.prototype.simple_combo = function(keys, callback) {
634
+ return this.register_combo({
635
+ keys: keys,
636
+ on_keydown: callback
637
+ });
638
+ };
639
+
640
+ Listener.prototype.counting_combo = function(keys, count_callback) {
641
+ return this.register_combo({
642
+ keys: keys,
643
+ is_counting: true,
644
+ is_unordered: false,
645
+ on_keydown: count_callback
646
+ });
647
+ };
648
+
649
+ Listener.prototype.sequence_combo = function(keys, callback) {
650
+ return this.register_combo({
651
+ keys: keys,
652
+ on_keydown: callback,
653
+ is_sequence: true
654
+ });
655
+ };
656
+
657
+ Listener.prototype.register_combo = function(combo_dictionary) {
658
+ var combo, property, value, _ref;
659
+ if (typeof combo_dictionary["keys"] === "string") {
660
+ combo_dictionary["keys"] = combo_dictionary["keys"].split(" ");
661
+ }
662
+ _ref = this._defaults;
663
+ for (property in _ref) {
664
+ if (!__hasProp.call(_ref, property)) continue;
665
+ value = _ref[property];
666
+ if (combo_dictionary[property] === void 0) {
667
+ combo_dictionary[property] = value;
668
+ }
669
+ }
670
+ combo = new Combo(combo_dictionary);
671
+ if (_validate_combo(combo)) {
672
+ this._registered_combos.push(combo);
673
+ return combo;
674
+ }
675
+ };
676
+
677
+ Listener.prototype.register_many = function(combo_array) {
678
+ var combo, _i, _len, _results;
679
+ _results = [];
680
+ for (_i = 0, _len = combo_array.length; _i < _len; _i++) {
681
+ combo = combo_array[_i];
682
+ _results.push(this.register_combo(combo));
683
+ }
684
+ return _results;
685
+ };
686
+
687
+ Listener.prototype.unregister_combo = function(keys_or_combo) {
688
+ var combo, unregister_combo, _i, _len, _ref, _results;
689
+ if (!keys_or_combo) {
690
+ return false;
691
+ }
692
+ unregister_combo = (function(_this) {
693
+ return function(combo) {
694
+ var i, _i, _ref, _results;
695
+ _results = [];
696
+ for (i = _i = 0, _ref = _this._registered_combos.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
697
+ if (combo === _this._registered_combos[i]) {
698
+ _this._registered_combos.splice(i, 1);
699
+ break;
700
+ } else {
701
+ _results.push(void 0);
702
+ }
703
+ }
704
+ return _results;
705
+ };
706
+ })(this);
707
+ if (keys_or_combo instanceof Combo) {
708
+ return unregister_combo(keys_or_combo);
709
+ } else {
710
+ if (typeof keys_or_combo === "string") {
711
+ keys_or_combo = keys_or_combo.split(" ");
712
+ }
713
+ _ref = this._registered_combos;
714
+ _results = [];
715
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
716
+ combo = _ref[_i];
717
+ if (combo == null) {
718
+ continue;
719
+ }
720
+ if ((combo.is_unordered && _compare_arrays(keys_or_combo, combo.keys)) || (!combo.is_unordered && _compare_arrays_sorted(keys_or_combo, combo.keys))) {
721
+ _results.push(unregister_combo(combo));
722
+ } else {
723
+ _results.push(void 0);
724
+ }
725
+ }
726
+ return _results;
727
+ }
728
+ };
729
+
730
+ Listener.prototype.unregister_many = function(combo_array) {
731
+ var combo, _i, _len, _results;
732
+ _results = [];
733
+ for (_i = 0, _len = combo_array.length; _i < _len; _i++) {
734
+ combo = combo_array[_i];
735
+ _results.push(this.unregister_combo(combo));
736
+ }
737
+ return _results;
738
+ };
739
+
740
+ Listener.prototype.get_registered_combos = function() {
741
+ return this._registered_combos;
742
+ };
743
+
744
+ Listener.prototype.reset = function() {
745
+ return this._registered_combos = [];
746
+ };
747
+
748
+ Listener.prototype.listen = function() {
749
+ return this._prevent_capture = false;
750
+ };
751
+
752
+ Listener.prototype.stop_listening = function() {
753
+ return this._prevent_capture = true;
754
+ };
755
+
756
+ Listener.prototype.get_meta_key = function() {
757
+ return _metakey;
758
+ };
759
+
760
+ return Listener;
761
+
762
+ })();
763
+
764
+ _decide_meta_key = function() {
765
+ if (navigator.userAgent.indexOf("Mac OS X") !== -1) {
766
+ _metakey = "cmd";
767
+ }
768
+ };
769
+
770
+ _change_keycodes_by_browser = function() {
771
+ if (navigator.userAgent.indexOf("Opera") !== -1) {
772
+ _keycode_dictionary["17"] = "cmd";
773
+ }
774
+ };
775
+
776
+ _convert_key_to_readable = function(k) {
777
+ return _keycode_dictionary[k];
778
+ };
779
+
780
+ _filter_array = function(array, callback) {
781
+ var element;
782
+ if (array.filter) {
783
+ return array.filter(callback);
784
+ } else {
785
+ return (function() {
786
+ var _i, _len, _results;
787
+ _results = [];
788
+ for (_i = 0, _len = array.length; _i < _len; _i++) {
789
+ element = array[_i];
790
+ if (callback(element)) {
791
+ _results.push(element);
792
+ }
793
+ }
794
+ return _results;
795
+ })();
796
+ }
797
+ };
798
+
799
+ _compare_arrays = function(a1, a2) {
800
+ var item, _i, _len;
801
+ if (a1.length !== a2.length) {
802
+ return false;
803
+ }
804
+ for (_i = 0, _len = a1.length; _i < _len; _i++) {
805
+ item = a1[_i];
806
+ if (__indexOf.call(a2, item) >= 0) {
807
+ continue;
808
+ }
809
+ return false;
810
+ }
811
+ return true;
812
+ };
813
+
814
+ _compare_arrays_sorted = function(a1, a2) {
815
+ var i, _i, _ref;
816
+ if (a1.length !== a2.length) {
817
+ return false;
818
+ }
819
+ for (i = _i = 0, _ref = a1.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
820
+ if (a1[i] !== a2[i]) {
821
+ return false;
822
+ }
823
+ }
824
+ return true;
825
+ };
826
+
827
+ _is_array_in_array = function(a1, a2) {
828
+ var item, _i, _len;
829
+ for (_i = 0, _len = a1.length; _i < _len; _i++) {
830
+ item = a1[_i];
831
+ if (__indexOf.call(a2, item) < 0) {
832
+ return false;
833
+ }
834
+ }
835
+ return true;
836
+ };
837
+
838
+ _index_of_in_array = Array.prototype.indexOf || function(a, item) {
839
+ var i, _i, _ref;
840
+ for (i = _i = 0, _ref = a.length; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {
841
+ if (a[i] === item) {
842
+ return i;
843
+ }
844
+ }
845
+ return -1;
846
+ };
847
+
848
+ _is_array_in_array_sorted = function(a1, a2) {
849
+ var index, item, prev, _i, _len;
850
+ prev = 0;
851
+ for (_i = 0, _len = a1.length; _i < _len; _i++) {
852
+ item = a1[_i];
853
+ index = _index_of_in_array.call(a2, item);
854
+ if (index >= prev) {
855
+ prev = index;
856
+ } else {
857
+ return false;
858
+ }
859
+ }
860
+ return true;
861
+ };
862
+
863
+ _log_error = function() {
864
+ if (keypress.debug) {
865
+ return console.log.apply(console, arguments);
866
+ }
867
+ };
868
+
869
+ _key_is_valid = function(key) {
870
+ var valid, valid_key, _;
871
+ valid = false;
872
+ for (_ in _keycode_dictionary) {
873
+ valid_key = _keycode_dictionary[_];
874
+ if (key === valid_key) {
875
+ valid = true;
876
+ break;
877
+ }
878
+ }
879
+ if (!valid) {
880
+ for (_ in _keycode_shifted_keys) {
881
+ valid_key = _keycode_shifted_keys[_];
882
+ if (key === valid_key) {
883
+ valid = true;
884
+ break;
885
+ }
886
+ }
887
+ }
888
+ return valid;
889
+ };
890
+
891
+ _validate_combo = function(combo) {
892
+ var alt_name, i, key, mod_key, non_modifier_keys, property, validated, value, _i, _j, _k, _len, _len1, _ref, _ref1;
893
+ validated = true;
894
+ if (!combo.keys.length) {
895
+ _log_error("You're trying to bind a combo with no keys:", combo);
896
+ }
897
+ for (i = _i = 0, _ref = combo.keys.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
898
+ key = combo.keys[i];
899
+ alt_name = _keycode_alternate_names[key];
900
+ if (alt_name) {
901
+ key = combo.keys[i] = alt_name;
902
+ }
903
+ if (key === "meta") {
904
+ combo.keys.splice(i, 1, _metakey);
905
+ }
906
+ if (key === "cmd") {
907
+ _log_error("Warning: use the \"meta\" key rather than \"cmd\" for Windows compatibility");
908
+ }
909
+ }
910
+ _ref1 = combo.keys;
911
+ for (_j = 0, _len = _ref1.length; _j < _len; _j++) {
912
+ key = _ref1[_j];
913
+ if (!_key_is_valid(key)) {
914
+ _log_error("Do not recognize the key \"" + key + "\"");
915
+ validated = false;
916
+ }
917
+ }
918
+ if (__indexOf.call(combo.keys, "meta") >= 0 || __indexOf.call(combo.keys, "cmd") >= 0) {
919
+ non_modifier_keys = combo.keys.slice();
920
+ for (_k = 0, _len1 = _modifier_keys.length; _k < _len1; _k++) {
921
+ mod_key = _modifier_keys[_k];
922
+ if ((i = _index_of_in_array.call(non_modifier_keys, mod_key)) > -1) {
923
+ non_modifier_keys.splice(i, 1);
924
+ }
925
+ }
926
+ if (non_modifier_keys.length > 1) {
927
+ _log_error("META and CMD key combos cannot have more than 1 non-modifier keys", combo, non_modifier_keys);
928
+ validated = false;
929
+ }
930
+ }
931
+ for (property in combo) {
932
+ value = combo[property];
933
+ if (_factory_defaults[property] === "undefined") {
934
+ _log_error("The property " + property + " is not a valid combo property. Your combo has still been registered.");
935
+ }
936
+ }
937
+ return validated;
938
+ };
939
+
940
+ _convert_to_shifted_key = function(key, e) {
941
+ var k;
942
+ if (!e.shiftKey) {
943
+ return false;
944
+ }
945
+ k = _keycode_shifted_keys[key];
946
+ if (k != null) {
947
+ return k;
948
+ }
949
+ return false;
950
+ };
951
+
952
+ _modifier_event_mapping = {
953
+ "cmd": "metaKey",
954
+ "ctrl": "ctrlKey",
955
+ "shift": "shiftKey",
956
+ "alt": "altKey"
957
+ };
958
+
959
+ _keycode_alternate_names = {
960
+ "escape": "esc",
961
+ "control": "ctrl",
962
+ "command": "cmd",
963
+ "break": "pause",
964
+ "windows": "cmd",
965
+ "option": "alt",
966
+ "caps_lock": "caps",
967
+ "apostrophe": "\'",
968
+ "semicolon": ";",
969
+ "tilde": "~",
970
+ "accent": "`",
971
+ "scroll_lock": "scroll",
972
+ "num_lock": "num"
973
+ };
974
+
975
+ _keycode_shifted_keys = {
976
+ "/": "?",
977
+ ".": ">",
978
+ ",": "<",
979
+ "\'": "\"",
980
+ ";": ":",
981
+ "[": "{",
982
+ "]": "}",
983
+ "\\": "|",
984
+ "`": "~",
985
+ "=": "+",
986
+ "-": "_",
987
+ "1": "!",
988
+ "2": "@",
989
+ "3": "#",
990
+ "4": "$",
991
+ "5": "%",
992
+ "6": "^",
993
+ "7": "&",
994
+ "8": "*",
995
+ "9": "(",
996
+ "0": ")"
997
+ };
998
+
999
+ _keycode_dictionary = {
1000
+ 0: "\\",
1001
+ 8: "backspace",
1002
+ 9: "tab",
1003
+ 12: "num",
1004
+ 13: "enter",
1005
+ 16: "shift",
1006
+ 17: "ctrl",
1007
+ 18: "alt",
1008
+ 19: "pause",
1009
+ 20: "caps",
1010
+ 27: "esc",
1011
+ 32: "space",
1012
+ 33: "pageup",
1013
+ 34: "pagedown",
1014
+ 35: "end",
1015
+ 36: "home",
1016
+ 37: "left",
1017
+ 38: "up",
1018
+ 39: "right",
1019
+ 40: "down",
1020
+ 44: "print",
1021
+ 45: "insert",
1022
+ 46: "delete",
1023
+ 48: "0",
1024
+ 49: "1",
1025
+ 50: "2",
1026
+ 51: "3",
1027
+ 52: "4",
1028
+ 53: "5",
1029
+ 54: "6",
1030
+ 55: "7",
1031
+ 56: "8",
1032
+ 57: "9",
1033
+ 65: "a",
1034
+ 66: "b",
1035
+ 67: "c",
1036
+ 68: "d",
1037
+ 69: "e",
1038
+ 70: "f",
1039
+ 71: "g",
1040
+ 72: "h",
1041
+ 73: "i",
1042
+ 74: "j",
1043
+ 75: "k",
1044
+ 76: "l",
1045
+ 77: "m",
1046
+ 78: "n",
1047
+ 79: "o",
1048
+ 80: "p",
1049
+ 81: "q",
1050
+ 82: "r",
1051
+ 83: "s",
1052
+ 84: "t",
1053
+ 85: "u",
1054
+ 86: "v",
1055
+ 87: "w",
1056
+ 88: "x",
1057
+ 89: "y",
1058
+ 90: "z",
1059
+ 91: "cmd",
1060
+ 92: "cmd",
1061
+ 93: "cmd",
1062
+ 96: "num_0",
1063
+ 97: "num_1",
1064
+ 98: "num_2",
1065
+ 99: "num_3",
1066
+ 100: "num_4",
1067
+ 101: "num_5",
1068
+ 102: "num_6",
1069
+ 103: "num_7",
1070
+ 104: "num_8",
1071
+ 105: "num_9",
1072
+ 106: "num_multiply",
1073
+ 107: "num_add",
1074
+ 108: "num_enter",
1075
+ 109: "num_subtract",
1076
+ 110: "num_decimal",
1077
+ 111: "num_divide",
1078
+ 112: "f1",
1079
+ 113: "f2",
1080
+ 114: "f3",
1081
+ 115: "f4",
1082
+ 116: "f5",
1083
+ 117: "f6",
1084
+ 118: "f7",
1085
+ 119: "f8",
1086
+ 120: "f9",
1087
+ 121: "f10",
1088
+ 122: "f11",
1089
+ 123: "f12",
1090
+ 124: "print",
1091
+ 144: "num",
1092
+ 145: "scroll",
1093
+ 186: ";",
1094
+ 187: "=",
1095
+ 188: ",",
1096
+ 189: "-",
1097
+ 190: ".",
1098
+ 191: "/",
1099
+ 192: "`",
1100
+ 219: "[",
1101
+ 220: "\\",
1102
+ 221: "]",
1103
+ 222: "\'",
1104
+ 223: "`",
1105
+ 224: "cmd",
1106
+ 225: "alt",
1107
+ 57392: "ctrl",
1108
+ 63289: "num",
1109
+ 59: ";",
1110
+ 61: "-",
1111
+ 173: "="
1112
+ };
1113
+
1114
+ keypress._keycode_dictionary = _keycode_dictionary;
1115
+
1116
+ keypress._is_array_in_array_sorted = _is_array_in_array_sorted;
1117
+
1118
+ _decide_meta_key();
1119
+
1120
+ _change_keycodes_by_browser();
1121
+
1122
+ if (typeof define === "function" && define.amd) {
1123
+ define([], function() {
1124
+ return keypress;
1125
+ });
1126
+ } else if (typeof exports !== "undefined" && exports !== null) {
1127
+ exports.keypress = keypress;
1128
+ } else {
1129
+ window.keypress = keypress;
1130
+ }
1131
+
1132
+ }).call(this);