MCPcopy Index your code
hub / github.com/CodeboxIDE/codebox / _handleKeyEvent

Function _handleKeyEvent

client/vendors/mousetrap.js:552–574  ·  view source on GitHub ↗

* handles a keydown event * * @param {Event} e * @returns void

(e)

Source from the content-addressed store, hash-verified

550 * @returns void
551 */
552 function _handleKeyEvent(e) {
553
554 // normalize e.which for key events
555 // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
556 if (typeof e.which !== 'number') {
557 e.which = e.keyCode;
558 }
559
560 var character = _characterFromEvent(e);
561
562 // no character found then stop
563 if (!character) {
564 return;
565 }
566
567 // need to use === for the character check because the character can be 0
568 if (e.type == 'keyup' && _ignoreNextKeyup === character) {
569 _ignoreNextKeyup = false;
570 return;
571 }
572
573 Mousetrap.handleKey(character, _eventModifiers(e), e);
574 }
575
576 /**
577 * determines if the keycode specified is a modifier key or not

Callers

nothing calls this directly

Calls 2

_characterFromEventFunction · 0.85
_eventModifiersFunction · 0.85

Tested by

no test coverage detected