Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hotkey chapters like mpv #5468

Open
enter-a-random-username opened this issue May 9, 2024 · 0 comments
Open

Support hotkey chapters like mpv #5468

enter-a-random-username opened this issue May 9, 2024 · 0 comments
Labels
enhancement Improve existing functionality or small fixes

Comments

@enter-a-random-username
Copy link

Easy way to change chapters, go back or forwards.

diff --git a/src/scripts/keyboardNavigation.js b/src/scripts/keyboardNavigation.js
index dedea77d7..dedea77d5 100644
--- a/src/scripts/keyboardNavigation.js
+++ b/src/scripts/keyboardNavigation.js
@@ -43,7 +43,7 @@ const KeyNames = {
 /**
  * Keys used for keyboard navigation.
  */
-const NavigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
+const NavigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'PageUp', 'PageDown'];
 
 /**
  * Elements for which navigation should be constrained.
@@ -140,6 +140,13 @@ export function enable() {
                 inputManager.handleCommand('down');
                 break;
 
+            case 'PageUp':
+                inputManager.handleCommand('nextchapter');
+                break;
+            case 'PageDown':
+                inputManager.handleCommand('previouschapter');
+                break;
+
             case 'Back':
                 inputManager.handleCommand('back');
                 break;

In general more hotkeys would be nice. Maybe even a mapping option for common controls from the player.

@enter-a-random-username enter-a-random-username added the enhancement Improve existing functionality or small fixes label May 9, 2024
@enter-a-random-username enter-a-random-username changed the title Support hotkey chapter like mpv Support hotkey chapters like mpv May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing functionality or small fixes
Projects
None yet
Development

No branches or pull requests

1 participant