UNPKG

combokeys

Version:

Handles keyboard shortcuts in the browser

22 lines (20 loc) 443 B
/* eslint-env node, browser */ 'use strict' /** * called to set a 1 second timeout on the specified sequence * * this is so after each key press in the sequence you have 1 second * to press the next key before you have to start over * * @returns void */ module.exports = function () { var self = this clearTimeout(self.resetTimer) self.resetTimer = setTimeout( function () { self.resetSequences() }, 1000 ) }