diff options
Diffstat (limited to 'client/js/util/keyboard.js')
| -rw-r--r-- | client/js/util/keyboard.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/js/util/keyboard.js b/client/js/util/keyboard.js index 3fe3263..c66eda1 100644 --- a/client/js/util/keyboard.js +++ b/client/js/util/keyboard.js @@ -21,6 +21,13 @@ function bind(hotkey, func) { } return false; } +function bindElement(element, hotkey, func) { + if (settings.get().keyboardShortcuts) { + mousetrap(element).bind(hotkey, func); + return true; + } + return false; +} function unbind(hotkey) { mousetrap.unbind(hotkey); @@ -28,6 +35,7 @@ function unbind(hotkey) { module.exports = { bind: bind, + bindElement: bindElement, unbind: unbind, pause: () => { paused = true; |