Keyboard logic

This commit is contained in:
Sam Potts
2017-11-06 20:34:11 +11:00
parent 3a9beaed59
commit 9c4b7e7094
6 changed files with 10 additions and 7 deletions

View File

@ -325,10 +325,10 @@ const listeners = {
};
// Keyboard shortcuts
if (this.config.keyboard.focused) {
utils.on(this.elements.container, 'keydown keyup', handleKey, false);
} else if (this.config.keyboard.global) {
if (this.config.keyboard.global) {
utils.on(window, 'keydown keyup', handleKey, false);
} else if (this.config.keyboard.focused) {
utils.on(this.elements.container, 'keydown keyup', handleKey, false);
}
// Detect tab focus