Skip to content

Add configurable hotkeys#1677

Merged
Arnei merged 8 commits intoopencast:developfrom
Arnei:configurable-hotkeys
Apr 22, 2026
Merged

Add configurable hotkeys#1677
Arnei merged 8 commits intoopencast:developfrom
Arnei:configurable-hotkeys

Conversation

@Arnei
Copy link
Copy Markdown
Member

@Arnei Arnei commented Feb 4, 2026

Allows users to configure their own hotkeys.
This should empower users to choose the hotkeys that work for them, instead of having to use the cumbersome "Shift + Alt + something" combinations.

Configured hotkeys are persisted in local storage. To that end, this patch introduces the redux-persist package and all the necessary boilerplate that it requires.

This also makes more changes to KeyboardControls.tsx than strictly necessary in the hopes of making it a little less complicated.

Bildschirmfoto vom 2026-02-04 12-52-50 Bildschirmfoto vom 2026-02-04 12-52-38

@Arnei Arnei added the type:enhancement New feature or request label Feb 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 4, 2026

This pull request is deployed at test.editor.opencast.org/1677/2026-04-20_11-37-07/ .
It might take a few minutes for it to become available.

@github-actions github-actions Bot added the status:conflicts Conflicts with another pull request or issue label Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@Arnei Arnei force-pushed the configurable-hotkeys branch from a1b0d4c to 6de7cd5 Compare April 9, 2026 09:12
@github-actions github-actions Bot added status:conflicts Conflicts with another pull request or issue and removed status:conflicts Conflicts with another pull request or issue labels Apr 9, 2026
@github-actions
Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@Arnei Arnei force-pushed the configurable-hotkeys branch from 6de7cd5 to f9e9dcd Compare April 14, 2026 08:27
@github-actions github-actions Bot removed the status:conflicts Conflicts with another pull request or issue label Apr 14, 2026
@ferishili ferishili self-requested a review April 15, 2026 07:23
@ferishili ferishili self-assigned this Apr 15, 2026
Comment thread src/main/KeyboardControls.tsx Outdated
Comment thread src/main/KeyboardControls.tsx
Copy link
Copy Markdown
Contributor

@ferishili ferishili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Arnei,

Here are a few points I'd like to highlight after testing the current behavior:

  1. Saving without a key combination clears the entry silently

    • Right now, saving without entering a key combination results in an empty value being saved.
    • At minimum, the UI should notify the user that the existing shortcut is being removed.
    • Ideally, saving an empty value should be prevented entirely, and instead a dedicated Delete option should be provided (either inside the modal or, even better, next to the edit button with a confirmation step).
  2. Empty key combinations are displayed as a small gray square

    • When an entry has no assigned key combination, the UI currently shows a small gray square.
    • It would be clearer to display a label such as "Not defined" or "No combination" instead.
  3. Duplicate key combinations are currently allowed

    • At the moment, it's possible to assign the same shortcut (e.g., ArrowLeft) to multiple entries.
    • The system should detect duplicates and notify the user.
    • Ideally, the UI should offer the option to replace the existing assignment with confirmation.
  4. resetHotkey and resetAllHotkeys reducers delete instead of reset

    • The reducers resetHotkey and resetAllHotkeys in src/redux/hotkeySlice.ts currently remove values instead of restoring defaults, and they are not being used.
    • It would be better if these reducers restored the default key combinations instead.
    • I'd also suggest adding "Reset to default" (per entry) and "Reset all to default" actions on the keyboard controls page.

@Arnei Arnei force-pushed the configurable-hotkeys branch from f9e9dcd to 8e62469 Compare April 15, 2026 12:30
@github-actions github-actions Bot added the status:conflicts Conflicts with another pull request or issue label Apr 15, 2026
@github-actions
Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@Arnei
Copy link
Copy Markdown
Member Author

Arnei commented Apr 16, 2026

Thanks for the nice suggestions. I hope I managed to address them reasonably well.

Arnei added 6 commits April 16, 2026 14:17
Allows users to configure their own hotkeys.
This should empower users to choose the hotkeys that
work for them, instead of having to use the cumbersome
"Shift + Alt + something" combinations.

Configured hotkeys are persisted in local storage.
To that end, this patch introduces the redux-persist package and
all the necessary boilerplate that
it requires.

This also makes more changes to KeyboardControls.tsx than
strictly necessary in the hopes
of making it a little less complicated.
With this changed the key recorder or hotkeys
should listen for the produced key, better supporting alternative
keyboards.
Setting a hotkey to nothing was possibly before, but felt very
unintentional as the user had to save an empty hotkey sequence.
This prevents users from saving empty hotkeys sequences, and instead
gives them an explicit button for unsetting.
Do not allow a user to set a hotkey if that hotkey already exists.
Disables in the save button in such a case and shows a warning
message.
To allow user to reset a hotkey to its default sequence(s).
We use "+" for delimiting purposes, so it would be problematic
if user included that in their hotkeys sequence.
@Arnei Arnei force-pushed the configurable-hotkeys branch from 92bc136 to 151b125 Compare April 16, 2026 12:17
@github-actions github-actions Bot removed the status:conflicts Conflicts with another pull request or issue label Apr 16, 2026
@ferishili
Copy link
Copy Markdown
Contributor

Thanks @arne,
the requested changes are covered now!

However, there are still a couple of small things left to address:

  1. The space key is shown as an empty box after saving, and it is not displayed when entering it before saving.
Screenshot 2026-04-16 at 14 34 03
  1. The key combination is currently not limited (when spaces are used between keys?). This makes it possible to enter a lot of keys in a single shortcut, which should not be allowed.
    Please limit the combination to a maximum of 3 keys in any case.
Screenshot 2026-04-16 at 14 39 52

Arnei added 2 commits April 20, 2026 13:24
Because we need the actual key for proper rendering.
@Arnei Arnei requested a review from ferishili April 21, 2026 14:36
Copy link
Copy Markdown
Contributor

@ferishili ferishili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arnei thanks!
I can confirm that everything works as expected!

@Arnei Arnei merged commit 1c21c30 into opencast:develop Apr 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants