MCPcopy
hub / github.com/CodeboxIDE/codebox / _callbackAndReset

Function _callbackAndReset

client/vendors/mousetrap.js:685–698  ·  view source on GitHub ↗

* wraps the specified callback inside of another function in order * to reset all sequence counters as soon as this sequence is done * * @param {Event} e * @returns void

(e)

Source from the content-addressed store, hash-verified

683 * @returns void
684 */
685 function _callbackAndReset(e) {
686 _fireCallback(callback, e, combo);
687
688 // we should ignore the next key up if the action is key down
689 // or keypress. this is so if you finish a sequence and
690 // release the key the final key will not trigger a keyup
691 if (action !== 'keyup') {
692 _ignoreNextKeyup = _characterFromEvent(e);
693 }
694
695 // weird race condition if a sequence ends with the key
696 // another sequence begins with
697 setTimeout(_resetSequences, 10);
698 }
699
700 // loop through keys one at a time and bind the appropriate callback
701 // function. for any key leading up to the final one it should

Callers

nothing calls this directly

Calls 2

_fireCallbackFunction · 0.85
_characterFromEventFunction · 0.85

Tested by

no test coverage detected