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

[Bug] Hotkeys rebinding by keyboard key fails to work correctly #4455

Open
wayfarer3130 opened this issue Nov 1, 2024 · 2 comments
Open
Assignees
Labels
Awaiting Reproduction Can we reproduce the reported bug?

Comments

@wayfarer3130
Copy link
Contributor

Describe the Bug

When rebinding a keyboard key to a new key, with a different action, the old binding can be removed, or can be left depending on ordering issues in the binding. As well, two keys cannot be bound to the same action.

Steps to Reproduce

Rebind the pageup key with:
{
commandName: 'incrementActiveViewport',
label: 'Next Image Viewport',
keys: 'pageup',
isEditable: true,
},

added as a new binding. This may or may not take affect depending on the keyboard binding setup.

The expected behaviour is that the pageup key binding gets replaced with the new command.

The current behavior

The binding may or may not occur depending on ordering

The expected behavior

The new binding should be updated correctly, and should allow binding to multiple keys.

OS

Windows 11

Node version

NA

Browser

Chrome

@wayfarer3130 wayfarer3130 added the Awaiting Reproduction Can we reproduce the reported bug? label Nov 1, 2024
@wayfarer3130 wayfarer3130 self-assigned this Nov 1, 2024
Copy link
Member

sedghi commented Nov 6, 2024

You need to modify your configuration file. There are hotkeys there. Have you done that?
platform/app/public/config/default.js

hotkeys: [
    {
      commandName: 'incrementActiveViewport',
      label: 'Next Viewport',
      keys: ['right'],
    },
    {
      commandName: 'decrementActiveViewport',
      label: 'Previous Viewport',
      keys: ['left'],
    },
    { commandName: 'rotateViewportCW', label: 'Rotate Right', keys: ['r'] },
    { commandName: 'rotateViewportCCW', label: 'Rotate Left', keys: ['l'] },
    { commandName: 'invertViewport', label: 'Invert', keys: ['i'] },
    {

@wayfarer3130
Copy link
Contributor Author

It is ordering dependent, if you assign an existing assigned key to a new function, for example
{ commandName: 'rotateViewportCW', label: 'Rotate Right', keys: ['r'] },
{ commandName: 'invertViewport, label: 'Rotate Right', keys: ['r'] },
{ commandName: 'rotateViewportCW', label: 'Rotate Right', keys: ['right'] },
then the ordering will delete one of the commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reproduction Can we reproduce the reported bug?
Projects
None yet
Development

No branches or pull requests

2 participants