Skip to content

Commit

Permalink
Support more shift-key selection shortcuts in EPUB view
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Sep 5, 2023
1 parent 327b859 commit 3ab43c9
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions src/dom/epub/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,35 +508,37 @@ export class PaginatedFlow extends AbstractFlow {
private _handleKeyDown = (event: KeyboardEvent) => {
let { key, shiftKey } = event;
// Left/right arrows are handled in EPUBView
if (key == 'ArrowUp') {
this.navigateToPreviousPage();
event.preventDefault();
return;
}
if (key == 'ArrowDown') {
this.navigateToNextPage();
event.preventDefault();
return;
}
if (key == 'PageUp') {
this.navigateToPreviousPage();
event.preventDefault();
return;
}
if (key == 'PageDown') {
this.navigateToNextPage();
event.preventDefault();
return;
}
if (key == 'Home') {
this.navigateToFirstPage();
event.preventDefault();
return;
}
if (key == 'End') {
this.navigateToLastPage();
event.preventDefault();
return;
if (!event.shiftKey) {
if (key == 'ArrowUp') {
this.navigateToPreviousPage();
event.preventDefault();
return;
}
if (key == 'ArrowDown') {
this.navigateToNextPage();
event.preventDefault();
return;
}
if (key == 'PageUp') {
this.navigateToPreviousPage();
event.preventDefault();
return;
}
if (key == 'PageDown') {
this.navigateToNextPage();
event.preventDefault();
return;
}
if (key == 'Home') {
this.navigateToFirstPage();
event.preventDefault();
return;
}
if (key == 'End') {
this.navigateToLastPage();
event.preventDefault();
return;
}
}
if (key == ' ') {
if (shiftKey) {
Expand Down

0 comments on commit 3ab43c9

Please sign in to comment.