class MousetrapProxy { constructor () { this.events = {} } emit (key) { if (!this.events[key]) return this.events[key].forEach((cb) => cb()) } bind (keys, cb) { const keysArray = typeof keys === 'string' ? [keys] : keys keysArray.forEach((key) => { if (!this.events[key]) { this.events[key] = [] Mousetrap.bind(key, () => { this.emit(key) }) } this.events[key].push(cb) }) } } var ee = new MousetrapProxy(); ee.bind(['command+shift+k', 'up'], function (e) { console.log('meow') }) ee.bind('command+shift+k', function (e) { console.log('ruff') })