mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-17 18:37:00 +02:00
@@ -24,22 +24,26 @@ export default class Keyboard {
|
||||
onKeyPress_(event) {
|
||||
let method;
|
||||
|
||||
if (event.which === Keys.SPACE) {
|
||||
switch (event.which) {
|
||||
case Keys.AV_PAGE:
|
||||
case Keys.SPACE:
|
||||
method = this.ws_.goNext;
|
||||
} else {
|
||||
if (this.ws_.isVertical) {
|
||||
if (event.which === Keys.DOWN) {
|
||||
method = this.ws_.goNext;
|
||||
} else if (event.which === Keys.UP) {
|
||||
break;
|
||||
case Keys.RE_PAGE:
|
||||
method = this.ws_.goPrev;
|
||||
}
|
||||
} else {
|
||||
if (event.which === Keys.RIGHT) {
|
||||
method = this.ws_.goNext;
|
||||
} else if (event.which === Keys.LEFT) {
|
||||
method = this.ws_.goPrev;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Keys.DOWN:
|
||||
method = this.ws_.isVertical ? this.ws_.goNext : null;
|
||||
break;
|
||||
case Keys.UP:
|
||||
method = this.ws_.isVertical ? this.ws_.goPrev : null;
|
||||
break;
|
||||
case Keys.LEFT:
|
||||
method = !this.ws_.isVertical ? this.ws_.goPrev : null;
|
||||
break;
|
||||
case Keys.RIGHT:
|
||||
method = !this.ws_.isVertical ? this.ws_.goNext : null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (method) {
|
||||
|
@@ -1,6 +1,8 @@
|
||||
const Keys = {
|
||||
ENTER: 13,
|
||||
SPACE: 32,
|
||||
RE_PAGE: 33,
|
||||
AV_PAGE: 34,
|
||||
LEFT: 37,
|
||||
UP: 38,
|
||||
RIGHT: 39,
|
||||
|
Reference in New Issue
Block a user