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