Use keydown event to get actual modifiers
This commit is contained in:
@@ -23,7 +23,7 @@ export class ComicsPlayer {
|
||||
this.imageMap = new Map();
|
||||
|
||||
this.onDialogClosed = this.onDialogClosed.bind(this);
|
||||
this.onWindowKeyUp = this.onWindowKeyUp.bind(this);
|
||||
this.onWindowKeyDown = this.onWindowKeyDown.bind(this);
|
||||
}
|
||||
|
||||
play(options) {
|
||||
@@ -177,7 +177,7 @@ export class ComicsPlayer {
|
||||
this.swiperInstance.update();
|
||||
}
|
||||
|
||||
onWindowKeyUp(e) {
|
||||
onWindowKeyDown(e) {
|
||||
const key = keyboardnavigation.getKeyName(e);
|
||||
if (key === 'Escape') {
|
||||
this.stop();
|
||||
@@ -196,7 +196,7 @@ export class ComicsPlayer {
|
||||
bindEvents() {
|
||||
this.bindMediaElementEvents();
|
||||
|
||||
document.addEventListener('keyup', this.onWindowKeyUp);
|
||||
document.addEventListener('keydown', this.onWindowKeyDown);
|
||||
}
|
||||
|
||||
unbindMediaElementEvents() {
|
||||
@@ -211,7 +211,7 @@ export class ComicsPlayer {
|
||||
unbindEvents() {
|
||||
this.unbindMediaElementEvents();
|
||||
|
||||
document.removeEventListener('keyup', this.onWindowKeyUp);
|
||||
document.removeEventListener('keydown', this.onWindowKeyDown);
|
||||
}
|
||||
|
||||
createMediaElement() {
|
||||
|
||||
Reference in New Issue
Block a user