/*\ title: $:/core/modules/utils/dom/keyboard.js type: application/javascript module-type: utils Keyboard utilities \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; var namedKeys = { "backspace": 8, "tab": 9, "enter": 13, "escape": 27 }; /* Parses a key descriptor into the structure: { keyCode: numeric keycode shiftKey: boolean altKey: boolean ctrlKey: boolean } Key descriptors have the following format: ctrl+enter ctrl+shift+alt+A */ exports.parseKeyDescriptor = function(keyDescriptor) { var components = keyDescriptor.split("+"), info = { keyCode: 0, shiftKey: false, altKey: false, ctrlKey: false }; for(var t=0; t