keyboard.js 109 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.keyboardJS=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  2. var Keyboard = require('./lib/keyboard');
  3. var Locale = require('./lib/locale');
  4. var KeyCombo = require('./lib/key-combo');
  5. var keyboard = new Keyboard();
  6. keyboard.setLocale('us', require('./locales/us'));
  7. exports = module.exports = keyboard;
  8. exports.Keyboard = Keyboard;
  9. exports.Locale = Locale;
  10. exports.KeyCombo = KeyCombo;
  11. },{"./lib/key-combo":2,"./lib/keyboard":3,"./lib/locale":4,"./locales/us":5}],2:[function(require,module,exports){
  12. function KeyCombo(keyComboStr) {
  13. this.sourceStr = keyComboStr;
  14. this.subCombos = KeyCombo.parseComboStr(keyComboStr);
  15. this.keyNames = this.subCombos.reduce(function(memo, nextSubCombo) {
  16. return memo.concat(nextSubCombo);
  17. });
  18. }
  19. // TODO: Add support for key combo sequences
  20. KeyCombo.sequenceDeliminator = '>>';
  21. KeyCombo.comboDeliminator = '>';
  22. KeyCombo.keyDeliminator = '+';
  23. KeyCombo.parseComboStr = function(keyComboStr) {
  24. var subComboStrs = KeyCombo._splitStr(keyComboStr, KeyCombo.comboDeliminator);
  25. var combo = [];
  26. for (var i = 0 ; i < subComboStrs.length; i += 1) {
  27. combo.push(KeyCombo._splitStr(subComboStrs[i], KeyCombo.keyDeliminator));
  28. }
  29. return combo;
  30. };
  31. KeyCombo.prototype.check = function(pressedKeyNames) {
  32. var startingKeyNameIndex = 0;
  33. for (var i = 0; i < this.subCombos.length; i += 1) {
  34. startingKeyNameIndex = this._checkSubCombo(
  35. this.subCombos[i],
  36. startingKeyNameIndex,
  37. pressedKeyNames
  38. );
  39. if (startingKeyNameIndex === -1) { return false; }
  40. }
  41. return true;
  42. };
  43. KeyCombo.prototype.isEqual = function(otherKeyCombo) {
  44. if (
  45. !otherKeyCombo ||
  46. typeof otherKeyCombo !== 'string' &&
  47. typeof otherKeyCombo !== 'object'
  48. ) { return false; }
  49. if (typeof otherKeyCombo === 'string') {
  50. otherKeyCombo = new KeyCombo(otherKeyCombo);
  51. }
  52. if (this.subCombos.length !== otherKeyCombo.subCombos.length) {
  53. return false;
  54. }
  55. for (var i = 0; i < this.subCombos.length; i += 1) {
  56. if (this.subCombos[i].length !== otherKeyCombo.subCombos[i].length) {
  57. return false;
  58. }
  59. }
  60. for (var i = 0; i < this.subCombos.length; i += 1) {
  61. var subCombo = this.subCombos[i];
  62. var otherSubCombo = otherKeyCombo.subCombos[i].slice(0);
  63. for (var j = 0; j < subCombo.length; j += 1) {
  64. var keyName = subCombo[j];
  65. var index = otherSubCombo.indexOf(keyName);
  66. if (index > -1) {
  67. otherSubCombo.splice(index, 1);
  68. }
  69. }
  70. if (otherSubCombo.length !== 0) {
  71. return false;
  72. }
  73. }
  74. return true;
  75. };
  76. KeyCombo._splitStr = function(str, deliminator) {
  77. var s = str;
  78. var d = deliminator;
  79. var c = '';
  80. var ca = [];
  81. for (var ci = 0; ci < s.length; ci += 1) {
  82. if (ci > 0 && s[ci] === d && s[ci - 1] !== '\\') {
  83. ca.push(c.trim());
  84. c = '';
  85. ci += 1;
  86. }
  87. c += s[ci];
  88. }
  89. if (c) { ca.push(c.trim()); }
  90. return ca;
  91. };
  92. KeyCombo.prototype._checkSubCombo = function(subCombo, startingKeyNameIndex, pressedKeyNames) {
  93. subCombo = subCombo.slice(0);
  94. pressedKeyNames = pressedKeyNames.slice(startingKeyNameIndex);
  95. var endIndex = startingKeyNameIndex;
  96. for (var i = 0; i < subCombo.length; i += 1) {
  97. var keyName = subCombo[i];
  98. if (keyName[0] === '\\') {
  99. var escapedKeyName = keyName.slice(1);
  100. if (
  101. escapedKeyName === KeyCombo.comboDeliminator ||
  102. escapedKeyName === KeyCombo.keyDeliminator
  103. ) {
  104. keyName = escapedKeyName;
  105. }
  106. }
  107. var index = pressedKeyNames.indexOf(keyName);
  108. if (index > -1) {
  109. subCombo.splice(i, 1);
  110. i -= 1;
  111. if (index > endIndex) {
  112. endIndex = index;
  113. }
  114. if (subCombo.length === 0) {
  115. return endIndex;
  116. }
  117. }
  118. }
  119. return -1;
  120. };
  121. module.exports = KeyCombo;
  122. },{}],3:[function(require,module,exports){
  123. (function (global){
  124. var Locale = require('./locale');
  125. var KeyCombo = require('./key-combo');
  126. function Keyboard(targetWindow, targetElement, platform, userAgent) {
  127. this._locale = null;
  128. this._currentContext = null;
  129. this._contexts = {};
  130. this._listeners = [];
  131. this._appliedListeners = [];
  132. this._locales = {};
  133. this._targetElement = null;
  134. this._targetWindow = null;
  135. this._targetPlatform = '';
  136. this._targetUserAgent = '';
  137. this._isModernBrowser = false;
  138. this._targetKeyDownBinding = null;
  139. this._targetKeyUpBinding = null;
  140. this._targetResetBinding = null;
  141. this._paused = false;
  142. this.setContext('global');
  143. this.watch(targetWindow, targetElement, platform, userAgent);
  144. }
  145. Keyboard.prototype.setLocale = function(localeName, localeBuilder) {
  146. var locale = null;
  147. if (typeof localeName === 'string') {
  148. if (localeBuilder) {
  149. locale = new Locale(localeName);
  150. localeBuilder(locale, this._targetPlatform, this._targetUserAgent);
  151. } else {
  152. locale = this._locales[localeName] || null;
  153. }
  154. } else {
  155. locale = localeName;
  156. localeName = locale._localeName;
  157. }
  158. this._locale = locale;
  159. this._locales[localeName] = locale;
  160. if (locale) {
  161. this._locale.pressedKeys = locale.pressedKeys;
  162. }
  163. };
  164. Keyboard.prototype.getLocale = function(localName) {
  165. localName || (localName = this._locale.localeName);
  166. return this._locales[localName] || null;
  167. };
  168. Keyboard.prototype.bind = function(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault) {
  169. if (keyComboStr === null || typeof keyComboStr === 'function') {
  170. preventRepeatByDefault = releaseHandler;
  171. releaseHandler = pressHandler;
  172. pressHandler = keyComboStr;
  173. keyComboStr = null;
  174. }
  175. if (
  176. keyComboStr &&
  177. typeof keyComboStr === 'object' &&
  178. typeof keyComboStr.length === 'number'
  179. ) {
  180. for (var i = 0; i < keyComboStr.length; i += 1) {
  181. this.bind(keyComboStr[i], pressHandler, releaseHandler);
  182. }
  183. return;
  184. }
  185. this._listeners.push({
  186. keyCombo : keyComboStr ? new KeyCombo(keyComboStr) : null,
  187. pressHandler : pressHandler || null,
  188. releaseHandler : releaseHandler || null,
  189. preventRepeat : preventRepeatByDefault || false,
  190. preventRepeatByDefault : preventRepeatByDefault || false
  191. });
  192. };
  193. Keyboard.prototype.addListener = Keyboard.prototype.bind;
  194. Keyboard.prototype.on = Keyboard.prototype.bind;
  195. Keyboard.prototype.unbind = function(keyComboStr, pressHandler, releaseHandler) {
  196. if (keyComboStr === null || typeof keyComboStr === 'function') {
  197. releaseHandler = pressHandler;
  198. pressHandler = keyComboStr;
  199. keyComboStr = null;
  200. }
  201. if (
  202. keyComboStr &&
  203. typeof keyComboStr === 'object' &&
  204. typeof keyComboStr.length === 'number'
  205. ) {
  206. for (var i = 0; i < keyComboStr.length; i += 1) {
  207. this.unbind(keyComboStr[i], pressHandler, releaseHandler);
  208. }
  209. return;
  210. }
  211. for (var i = 0; i < this._listeners.length; i += 1) {
  212. var listener = this._listeners[i];
  213. var comboMatches = !keyComboStr && !listener.keyCombo ||
  214. listener.keyCombo && listener.keyCombo.isEqual(keyComboStr);
  215. var pressHandlerMatches = !pressHandler && !releaseHandler ||
  216. !pressHandler && !listener.pressHandler ||
  217. pressHandler === listener.pressHandler;
  218. var releaseHandlerMatches = !pressHandler && !releaseHandler ||
  219. !releaseHandler && !listener.releaseHandler ||
  220. releaseHandler === listener.releaseHandler;
  221. if (comboMatches && pressHandlerMatches && releaseHandlerMatches) {
  222. this._listeners.splice(i, 1);
  223. i -= 1;
  224. }
  225. }
  226. };
  227. Keyboard.prototype.removeListener = Keyboard.prototype.unbind;
  228. Keyboard.prototype.off = Keyboard.prototype.unbind;
  229. Keyboard.prototype.setContext = function(contextName) {
  230. if(this._locale) { this.releaseAllKeys(); }
  231. if (!this._contexts[contextName]) {
  232. this._contexts[contextName] = [];
  233. }
  234. this._listeners = this._contexts[contextName];
  235. this._currentContext = contextName;
  236. };
  237. Keyboard.prototype.getContext = function() {
  238. return this._currentContext;
  239. };
  240. Keyboard.prototype.withContext = function(contextName, callback) {
  241. var previousContextName = this.getContext();
  242. this.setContext(contextName);
  243. callback();
  244. this.setContext(previousContextName);
  245. };
  246. Keyboard.prototype.watch = function(targetWindow, targetElement, targetPlatform, targetUserAgent) {
  247. var _this = this;
  248. this.stop();
  249. if (!targetWindow) {
  250. if (!global.addEventListener && !global.attachEvent) {
  251. throw new Error('Cannot find global functions addEventListener or attachEvent.');
  252. }
  253. targetWindow = global;
  254. }
  255. if (typeof targetWindow.nodeType === 'number') {
  256. targetUserAgent = targetPlatform;
  257. targetPlatform = targetElement;
  258. targetElement = targetWindow;
  259. targetWindow = global;
  260. }
  261. if (!targetWindow.addEventListener && !targetWindow.attachEvent) {
  262. throw new Error('Cannot find addEventListener or attachEvent methods on targetWindow.');
  263. }
  264. this._isModernBrowser = !!targetWindow.addEventListener;
  265. var userAgent = targetWindow.navigator && targetWindow.navigator.userAgent || '';
  266. var platform = targetWindow.navigator && targetWindow.navigator.platform || '';
  267. targetElement && targetElement !== null || (targetElement = targetWindow.document);
  268. targetPlatform && targetPlatform !== null || (targetPlatform = platform);
  269. targetUserAgent && targetUserAgent !== null || (targetUserAgent = userAgent);
  270. this._targetKeyDownBinding = function(event) {
  271. _this.pressKey(event.keyCode, event);
  272. };
  273. this._targetKeyUpBinding = function(event) {
  274. _this.releaseKey(event.keyCode, event);
  275. };
  276. this._targetResetBinding = function(event) {
  277. _this.releaseAllKeys(event)
  278. };
  279. this._bindEvent(targetElement, 'keydown', this._targetKeyDownBinding);
  280. this._bindEvent(targetElement, 'keyup', this._targetKeyUpBinding);
  281. this._bindEvent(targetWindow, 'focus', this._targetResetBinding);
  282. this._bindEvent(targetWindow, 'blur', this._targetResetBinding);
  283. this._targetElement = targetElement;
  284. this._targetWindow = targetWindow;
  285. this._targetPlatform = targetPlatform;
  286. this._targetUserAgent = targetUserAgent;
  287. };
  288. Keyboard.prototype.stop = function() {
  289. var _this = this;
  290. if (!this._targetElement || !this._targetWindow) { return; }
  291. this._unbindEvent(this._targetElement, 'keydown', this._targetKeyDownBinding);
  292. this._unbindEvent(this._targetElement, 'keyup', this._targetKeyUpBinding);
  293. this._unbindEvent(this._targetWindow, 'focus', this._targetResetBinding);
  294. this._unbindEvent(this._targetWindow, 'blur', this._targetResetBinding);
  295. this._targetWindow = null;
  296. this._targetElement = null;
  297. };
  298. Keyboard.prototype.pressKey = function(keyCode, event) {
  299. if (this._paused) { return; }
  300. if (!this._locale) { throw new Error('Locale not set'); }
  301. this._locale.pressKey(keyCode);
  302. this._applyBindings(event);
  303. };
  304. Keyboard.prototype.releaseKey = function(keyCode, event) {
  305. if (this._paused) { return; }
  306. if (!this._locale) { throw new Error('Locale not set'); }
  307. this._locale.releaseKey(keyCode);
  308. this._clearBindings(event);
  309. };
  310. Keyboard.prototype.releaseAllKeys = function(event) {
  311. if (this._paused) { return; }
  312. if (!this._locale) { throw new Error('Locale not set'); }
  313. this._locale.pressedKeys.length = 0;
  314. this._clearBindings(event);
  315. };
  316. Keyboard.prototype.pause = function() {
  317. if (this._paused) { return; }
  318. if (this._locale) { this.releaseAllKeys(); }
  319. this._paused = true;
  320. };
  321. Keyboard.prototype.resume = function() {
  322. this._paused = false;
  323. };
  324. Keyboard.prototype.reset = function() {
  325. this.releaseAllKeys();
  326. this._listeners.length = 0;
  327. };
  328. Keyboard.prototype._bindEvent = function(targetElement, eventName, handler) {
  329. return this._isModernBrowser ?
  330. targetElement.addEventListener(eventName, handler, false) :
  331. targetElement.attachEvent('on' + eventName, handler);
  332. };
  333. Keyboard.prototype._unbindEvent = function(targetElement, eventName, handler) {
  334. return this._isModernBrowser ?
  335. targetElement.removeEventListener(eventName, handler, false) :
  336. targetElement.detachEvent('on' + eventName, handler);
  337. };
  338. Keyboard.prototype._getGroupedListeners = function() {
  339. var listenerGroups = [];
  340. var listenerGroupMap = [];
  341. var listeners = this._listeners;
  342. if (this._currentContext !== 'global') {
  343. listeners = [].concat(listeners, this._contexts.global);
  344. }
  345. listeners.sort(function(a, b) {
  346. return (b.keyCombo ? b.keyCombo.keyNames.length : 0) - (a.keyCombo ? a.keyCombo.keyNames.length : 0);
  347. }).forEach(function(l) {
  348. var mapIndex = -1;
  349. for (var i = 0; i < listenerGroupMap.length; i += 1) {
  350. if (listenerGroupMap[i] === null && l.keyCombo === null ||
  351. listenerGroupMap[i] !== null && listenerGroupMap[i].isEqual(l.keyCombo)) {
  352. mapIndex = i;
  353. }
  354. }
  355. if (mapIndex === -1) {
  356. mapIndex = listenerGroupMap.length;
  357. listenerGroupMap.push(l.keyCombo);
  358. }
  359. if (!listenerGroups[mapIndex]) {
  360. listenerGroups[mapIndex] = [];
  361. }
  362. listenerGroups[mapIndex].push(l);
  363. });
  364. return listenerGroups;
  365. };
  366. Keyboard.prototype._applyBindings = function(event) {
  367. var preventRepeat = false;
  368. event || (event = {});
  369. event.preventRepeat = function() { preventRepeat = true; };
  370. event.pressedKeys = this._locale.pressedKeys.slice(0);
  371. var pressedKeys = this._locale.pressedKeys.slice(0);
  372. var listenerGroups = this._getGroupedListeners();
  373. for (var i = 0; i < listenerGroups.length; i += 1) {
  374. var listeners = listenerGroups[i];
  375. var keyCombo = listeners[0].keyCombo;
  376. if (keyCombo === null || keyCombo.check(pressedKeys)) {
  377. for (var j = 0; j < listeners.length; j += 1) {
  378. var listener = listeners[j];
  379. if (keyCombo === null) {
  380. listener = {
  381. keyCombo : new KeyCombo(pressedKeys.join('+')),
  382. pressHandler : listener.pressHandler,
  383. releaseHandler : listener.releaseHandler,
  384. preventRepeat : listener.preventRepeat,
  385. preventRepeatByDefault : listener.preventRepeatByDefault
  386. };
  387. }
  388. if (listener.pressHandler && !listener.preventRepeat) {
  389. listener.pressHandler.call(this, event);
  390. if (preventRepeat) {
  391. listener.preventRepeat = preventRepeat;
  392. preventRepeat = false;
  393. }
  394. }
  395. if (listener.releaseHandler && this._appliedListeners.indexOf(listener) === -1) {
  396. this._appliedListeners.push(listener);
  397. }
  398. }
  399. if (keyCombo) {
  400. for (var j = 0; j < keyCombo.keyNames.length; j += 1) {
  401. var index = pressedKeys.indexOf(keyCombo.keyNames[j]);
  402. if (index !== -1) {
  403. pressedKeys.splice(index, 1);
  404. j -= 1;
  405. }
  406. }
  407. }
  408. }
  409. }
  410. };
  411. Keyboard.prototype._clearBindings = function(event) {
  412. event || (event = {});
  413. for (var i = 0; i < this._appliedListeners.length; i += 1) {
  414. var listener = this._appliedListeners[i];
  415. var keyCombo = listener.keyCombo;
  416. if (keyCombo === null || !keyCombo.check(this._locale.pressedKeys)) {
  417. listener.preventRepeat = listener.preventRepeatByDefault;
  418. listener.releaseHandler.call(this, event);
  419. this._appliedListeners.splice(i, 1);
  420. i -= 1;
  421. }
  422. }
  423. };
  424. module.exports = Keyboard;
  425. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  426. //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9rZXlib2FyZC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ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Db21ibyA9PT0gbnVsbCkge1xuICAgICAgICAgIGxpc3RlbmVyID0ge1xuICAgICAgICAgICAga2V5Q29tYm8gICAgICAgICAgICAgICA6IG5ldyBLZXlDb21ibyhwcmVzc2VkS2V5cy5qb2luKCcrJykpLFxuICAgICAgICAgICAgcHJlc3NIYW5kbGVyICAgICAgICAgICA6IGxpc3RlbmVyLnByZXNzSGFuZGxlcixcbiAgICAgICAgICAgIHJlbGVhc2VIYW5kbGVyICAgICAgICAgOiBsaXN0ZW5lci5yZWxlYXNlSGFuZGxlcixcbiAgICAgICAgICAgIHByZXZlbnRSZXBlYXQgICAgICAgICAgOiBsaXN0ZW5lci5wcmV2ZW50UmVwZWF0LFxuICAgICAgICAgICAgcHJldmVudFJlcGVhdEJ5RGVmYXVsdCA6IGxpc3RlbmVyLnByZXZlbnRSZXBlYXRCeURlZmF1bHRcbiAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGxpc3RlbmVyLnByZXNzSGFuZGxlciAmJiAhbGlzdGVuZXIucHJldmVudFJlcGVhdCkge1xuICAgICAgICAgIGxpc3RlbmVyLnByZXNzSGFuZGxlci5jYWxsKHRoaXMsIGV2ZW50KTtcbiAgICAgICAgICBpZiAocHJldmVudFJlcGVhdCkge1xuICAgICAgICAgICAgbGlzdGVuZXIucHJldmVudFJlcGVhdCA9IHByZXZlbnRSZXBlYXQ7XG4gICAgICAgICAgICBwcmV2ZW50UmVwZWF0ICAgICAgICAgID0gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGxpc3RlbmVyLnJlbGVhc2VIYW5kbGVyICYmIHRoaXMuX2FwcGxpZWRMaXN0ZW5lcnMuaW5kZXhPZihsaXN0ZW5lcikgPT09IC0xKSB7XG4gICAgICAgICAgdGhpcy5fYXBwbGllZExpc3RlbmVycy5wdXNoKGxpc3RlbmVyKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoa2V5Q29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locale":4}],4:[function(require,module,exports){
  428. var KeyCombo = require('./key-combo');
  429. function Locale(name) {
  430. this.localeName = name;
  431. this.pressedKeys = [];
  432. this._appliedMacros = [];
  433. this._keyMap = {};
  434. this._killKeyCodes = [];
  435. this._macros = [];
  436. }
  437. Locale.prototype.bindKeyCode = function(keyCode, keyNames) {
  438. if (typeof keyNames === 'string') {
  439. keyNames = [keyNames];
  440. }
  441. this._keyMap[keyCode] = keyNames;
  442. };
  443. Locale.prototype.bindMacro = function(keyComboStr, keyNames) {
  444. if (typeof keyNames === 'string') {
  445. keyNames = [ keyNames ];
  446. }
  447. var handler = null;
  448. if (typeof keyNames === 'function') {
  449. handler = keyNames;
  450. keyNames = null;
  451. }
  452. var macro = {
  453. keyCombo : new KeyCombo(keyComboStr),
  454. keyNames : keyNames,
  455. handler : handler
  456. };
  457. this._macros.push(macro);
  458. };
  459. Locale.prototype.getKeyCodes = function(keyName) {
  460. var keyCodes = [];
  461. for (var keyCode in this._keyMap) {
  462. var index = this._keyMap[keyCode].indexOf(keyName);
  463. if (index > -1) { keyCodes.push(keyCode|0); }
  464. }
  465. return keyCodes;
  466. };
  467. Locale.prototype.getKeyNames = function(keyCode) {
  468. return this._keyMap[keyCode] || [];
  469. };
  470. Locale.prototype.setKillKey = function(keyCode) {
  471. if (typeof keyCode === 'string') {
  472. var keyCodes = this.getKeyCodes(keyCode);
  473. for (var i = 0; i < keyCodes.length; i += 1) {
  474. this.setKillKey(keyCodes[i]);
  475. }
  476. return;
  477. }
  478. this._killKeyCodes.push(keyCode);
  479. };
  480. Locale.prototype.pressKey = function(keyCode) {
  481. if (typeof keyCode === 'string') {
  482. var keyCodes = this.getKeyCodes(keyCode);
  483. for (var i = 0; i < keyCodes.length; i += 1) {
  484. this.pressKey(keyCodes[i]);
  485. }
  486. return;
  487. }
  488. var keyNames = this.getKeyNames(keyCode);
  489. for (var i = 0; i < keyNames.length; i += 1) {
  490. if (this.pressedKeys.indexOf(keyNames[i]) === -1) {
  491. this.pressedKeys.push(keyNames[i]);
  492. }
  493. }
  494. this._applyMacros();
  495. };
  496. Locale.prototype.releaseKey = function(keyCode) {
  497. if (typeof keyCode === 'string') {
  498. var keyCodes = this.getKeyCodes(keyCode);
  499. for (var i = 0; i < keyCodes.length; i += 1) {
  500. this.releaseKey(keyCodes[i]);
  501. }
  502. }
  503. else {
  504. var keyNames = this.getKeyNames(keyCode);
  505. var killKeyCodeIndex = this._killKeyCodes.indexOf(keyCode);
  506. if (killKeyCodeIndex > -1) {
  507. this.pressedKeys.length = 0;
  508. } else {
  509. for (var i = 0; i < keyNames.length; i += 1) {
  510. var index = this.pressedKeys.indexOf(keyNames[i]);
  511. if (index > -1) {
  512. this.pressedKeys.splice(index, 1);
  513. }
  514. }
  515. }
  516. this._clearMacros();
  517. }
  518. };
  519. Locale.prototype._applyMacros = function() {
  520. var macros = this._macros.slice(0);
  521. for (var i = 0; i < macros.length; i += 1) {
  522. var macro = macros[i];
  523. if (macro.keyCombo.check(this.pressedKeys)) {
  524. if (macro.handler) {
  525. macro.keyNames = macro.handler(this.pressedKeys);
  526. }
  527. for (var j = 0; j < macro.keyNames.length; j += 1) {
  528. if (this.pressedKeys.indexOf(macro.keyNames[j]) === -1) {
  529. this.pressedKeys.push(macro.keyNames[j]);
  530. }
  531. }
  532. this._appliedMacros.push(macro);
  533. }
  534. }
  535. };
  536. Locale.prototype._clearMacros = function() {
  537. for (var i = 0; i < this._appliedMacros.length; i += 1) {
  538. var macro = this._appliedMacros[i];
  539. if (!macro.keyCombo.check(this.pressedKeys)) {
  540. for (var j = 0; j < macro.keyNames.length; j += 1) {
  541. var index = this.pressedKeys.indexOf(macro.keyNames[j]);
  542. if (index > -1) {
  543. this.pressedKeys.splice(index, 1);
  544. }
  545. }
  546. if (macro.handler) {
  547. macro.keyNames = null;
  548. }
  549. this._appliedMacros.splice(i, 1);
  550. i -= 1;
  551. }
  552. }
  553. };
  554. module.exports = Locale;
  555. },{"./key-combo":2}],5:[function(require,module,exports){
  556. module.exports = function(locale, platform, userAgent) {
  557. // general
  558. locale.bindKeyCode(3, ['cancel']);
  559. locale.bindKeyCode(8, ['backspace']);
  560. locale.bindKeyCode(9, ['tab']);
  561. locale.bindKeyCode(12, ['clear']);
  562. locale.bindKeyCode(13, ['enter']);
  563. locale.bindKeyCode(16, ['shift']);
  564. locale.bindKeyCode(17, ['ctrl']);
  565. locale.bindKeyCode(18, ['alt', 'menu']);
  566. locale.bindKeyCode(19, ['pause', 'break']);
  567. locale.bindKeyCode(20, ['capslock']);
  568. locale.bindKeyCode(27, ['escape', 'esc']);
  569. locale.bindKeyCode(32, ['space', 'spacebar']);
  570. locale.bindKeyCode(33, ['pageup']);
  571. locale.bindKeyCode(34, ['pagedown']);
  572. locale.bindKeyCode(35, ['end']);
  573. locale.bindKeyCode(36, ['home']);
  574. locale.bindKeyCode(37, ['left']);
  575. locale.bindKeyCode(38, ['up']);
  576. locale.bindKeyCode(39, ['right']);
  577. locale.bindKeyCode(40, ['down']);
  578. locale.bindKeyCode(41, ['select']);
  579. locale.bindKeyCode(42, ['printscreen']);
  580. locale.bindKeyCode(43, ['execute']);
  581. locale.bindKeyCode(44, ['snapshot']);
  582. locale.bindKeyCode(45, ['insert', 'ins']);
  583. locale.bindKeyCode(46, ['delete', 'del']);
  584. locale.bindKeyCode(47, ['help']);
  585. locale.bindKeyCode(145, ['scrolllock', 'scroll']);
  586. locale.bindKeyCode(187, ['equal', 'equalsign', '=']);
  587. locale.bindKeyCode(188, ['comma', ',']);
  588. locale.bindKeyCode(190, ['period', '.']);
  589. locale.bindKeyCode(191, ['slash', 'forwardslash', '/']);
  590. locale.bindKeyCode(192, ['graveaccent', '`']);
  591. locale.bindKeyCode(219, ['openbracket', '[']);
  592. locale.bindKeyCode(220, ['backslash', '\\']);
  593. locale.bindKeyCode(221, ['closebracket', ']']);
  594. locale.bindKeyCode(222, ['apostrophe', '\'']);
  595. // 0-9
  596. locale.bindKeyCode(48, ['zero', '0']);
  597. locale.bindKeyCode(49, ['one', '1']);
  598. locale.bindKeyCode(50, ['two', '2']);
  599. locale.bindKeyCode(51, ['three', '3']);
  600. locale.bindKeyCode(52, ['four', '4']);
  601. locale.bindKeyCode(53, ['five', '5']);
  602. locale.bindKeyCode(54, ['six', '6']);
  603. locale.bindKeyCode(55, ['seven', '7']);
  604. locale.bindKeyCode(56, ['eight', '8']);
  605. locale.bindKeyCode(57, ['nine', '9']);
  606. // numpad
  607. locale.bindKeyCode(96, ['numzero', 'num0']);
  608. locale.bindKeyCode(97, ['numone', 'num1']);
  609. locale.bindKeyCode(98, ['numtwo', 'num2']);
  610. locale.bindKeyCode(99, ['numthree', 'num3']);
  611. locale.bindKeyCode(100, ['numfour', 'num4']);
  612. locale.bindKeyCode(101, ['numfive', 'num5']);
  613. locale.bindKeyCode(102, ['numsix', 'num6']);
  614. locale.bindKeyCode(103, ['numseven', 'num7']);
  615. locale.bindKeyCode(104, ['numeight', 'num8']);
  616. locale.bindKeyCode(105, ['numnine', 'num9']);
  617. locale.bindKeyCode(106, ['nummultiply', 'num*']);
  618. locale.bindKeyCode(107, ['numadd', 'num+']);
  619. locale.bindKeyCode(108, ['numenter']);
  620. locale.bindKeyCode(109, ['numsubtract', 'num-']);
  621. locale.bindKeyCode(110, ['numdecimal', 'num.']);
  622. locale.bindKeyCode(111, ['numdivide', 'num/']);
  623. locale.bindKeyCode(144, ['numlock', 'num']);
  624. // function keys
  625. locale.bindKeyCode(112, ['f1']);
  626. locale.bindKeyCode(113, ['f2']);
  627. locale.bindKeyCode(114, ['f3']);
  628. locale.bindKeyCode(115, ['f4']);
  629. locale.bindKeyCode(116, ['f5']);
  630. locale.bindKeyCode(117, ['f6']);
  631. locale.bindKeyCode(118, ['f7']);
  632. locale.bindKeyCode(119, ['f8']);
  633. locale.bindKeyCode(120, ['f9']);
  634. locale.bindKeyCode(121, ['f10']);
  635. locale.bindKeyCode(122, ['f11']);
  636. locale.bindKeyCode(123, ['f12']);
  637. // secondary key symbols
  638. locale.bindMacro('shift + `', ['tilde', '~']);
  639. locale.bindMacro('shift + 1', ['exclamation', 'exclamationpoint', '!']);
  640. locale.bindMacro('shift + 2', ['at', '@']);
  641. locale.bindMacro('shift + 3', ['number', '#']);
  642. locale.bindMacro('shift + 4', ['dollar', 'dollars', 'dollarsign', '$']);
  643. locale.bindMacro('shift + 5', ['percent', '%']);
  644. locale.bindMacro('shift + 6', ['caret', '^']);
  645. locale.bindMacro('shift + 7', ['ampersand', 'and', '&']);
  646. locale.bindMacro('shift + 8', ['asterisk', '*']);
  647. locale.bindMacro('shift + 9', ['openparen', '(']);
  648. locale.bindMacro('shift + 0', ['closeparen', ')']);
  649. locale.bindMacro('shift + -', ['underscore', '_']);
  650. locale.bindMacro('shift + =', ['plus', '+']);
  651. locale.bindMacro('shift + [', ['opencurlybrace', 'opencurlybracket', '{']);
  652. locale.bindMacro('shift + ]', ['closecurlybrace', 'closecurlybracket', '}']);
  653. locale.bindMacro('shift + \\', ['verticalbar', '|']);
  654. locale.bindMacro('shift + ;', ['colon', ':']);
  655. locale.bindMacro('shift + \'', ['quotationmark', '\'']);
  656. locale.bindMacro('shift + !,', ['openanglebracket', '<']);
  657. locale.bindMacro('shift + .', ['closeanglebracket', '>']);
  658. locale.bindMacro('shift + /', ['questionmark', '?']);
  659. //a-z and A-Z
  660. for (var keyCode = 65; keyCode <= 90; keyCode += 1) {
  661. var keyName = String.fromCharCode(keyCode + 32);
  662. var capitalKeyName = String.fromCharCode(keyCode);
  663. locale.bindKeyCode(keyCode, keyName);
  664. locale.bindMacro('shift + ' + keyName, capitalKeyName);
  665. locale.bindMacro('capslock + ' + keyName, capitalKeyName);
  666. }
  667. // browser caveats
  668. var semicolonKeyCode = userAgent.match('Firefox') ? 59 : 186;
  669. var dashKeyCode = userAgent.match('Firefox') ? 173 : 189;
  670. var leftCommandKeyCode;
  671. var rightCommandKeyCode;
  672. if (platform.match('Mac') && (userAgent.match('Safari') || userAgent.match('Chrome'))) {
  673. leftCommandKeyCode = 91;
  674. rightCommandKeyCode = 93;
  675. } else if(platform.match('Mac') && userAgent.match('Opera')) {
  676. leftCommandKeyCode = 17;
  677. rightCommandKeyCode = 17;
  678. } else if(platform.match('Mac') && userAgent.match('Firefox')) {
  679. leftCommandKeyCode = 224;
  680. rightCommandKeyCode = 224;
  681. }
  682. locale.bindKeyCode(semicolonKeyCode, ['semicolon', ';']);
  683. locale.bindKeyCode(dashKeyCode, ['dash', '-']);
  684. locale.bindKeyCode(leftCommandKeyCode, ['command', 'windows', 'win', 'super', 'leftcommand', 'leftwindows', 'leftwin', 'leftsuper']);
  685. locale.bindKeyCode(rightCommandKeyCode, ['command', 'windows', 'win', 'super', 'rightcommand', 'rightwindows', 'rightwin', 'rightsuper']);
  686. // kill keys
  687. locale.setKillKey('command');
  688. };
  689. },{}]},{},[1])(1)
  690. });
  691. //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsImxpYi9rZXktY29tYm8uanMiLCJsaWIva2V5Ym9hcmQuanMiLCJsaWIvbG9jYWxlLmpzIiwibG9jYWxlcy91cy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FDYkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7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mFyIGogPSAwOyBqIDwgbGlzdGVuZXJzLmxlbmd0aDsgaiArPSAxKSB7XG4gICAgICAgIHZhciBsaXN0ZW5lciA9IGxpc3RlbmVyc1tqXTtcblxuICAgICAgICBpZiAoa2V5Q29tYm8gPT09IG51bGwpIHtcbiAgICAgICAgICBsaXN0ZW5lciA9IHtcbiAgICAgICAgICAgIGtleUNvbWJvICAgICAgICAgICAgICAgOiBuZXcgS2V5Q29tYm8ocHJlc3NlZEtleXMuam9pbignKycpKSxcbiAgICAgICAgICAgIHByZXNzSGFuZGxlciAgICAgICAgICAgOiBsaXN0ZW5lci5wcmVzc0hhbmRsZXIsXG4gICAgICAgICAgICByZWxlYXNlSGFuZGxlciAgICAgICAgIDogbGlzdGVuZXIucmVsZWFzZUhhbmRsZXIsXG4gICAgICAgICAgICBwcmV2ZW50UmVwZWF0ICAgICAgICAgIDogbGlzdGVuZXIucHJldmVudFJlcGVhdCxcbiAgICAgICAgICAgIHByZXZlbnRSZXBlYXRCeURlZmF1bHQgOiBsaXN0ZW5lci5wcmV2ZW50UmVwZWF0QnlEZWZhdWx0XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChsaXN0ZW5lci5wcmVzc0hhbmRsZXIgJiYgIWxpc3RlbmVyLnByZXZlbnRSZXBlYXQpIHtcbiAgICAgICAgICBsaXN0ZW5lci5wcmVzc0hhbmRsZXIuY2FsbCh0aGlzLCBldmVudCk7XG4gICAgICAgICAgaWYgKHByZXZlbnRSZXBlYXQpIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLnByZXZlbnRSZXBlYXQgPSBwcmV2ZW50UmVwZWF0O1xuICAgICAgICAgICAgcHJldmVudFJlcGVhdCAgICAgICAgICA9IGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChsaXN0ZW5lci5yZWxlYXNlSGFuZGxlciAmJiB0aGlzLl9hcHBsaWVkTGlzdGVuZXJzLmluZGV4T2YobGlz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