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

Hotkeys do Not work on non-English Keyboard Layout #928

Open
Vovamzur opened this issue Aug 22, 2024 · 6 comments
Open

Hotkeys do Not work on non-English Keyboard Layout #928

Vovamzur opened this issue Aug 22, 2024 · 6 comments
Labels
backlog Queued in backlog bug Something isn't working

Comments

@Vovamzur
Copy link

Vovamzur commented Aug 22, 2024

Describe the Bug

The problem relates to detecting key events, particularly when relying on the event.key property, which returns different values depending on the active keyboard layout. We should fix it in https://github.com/bpmn-io/diagram-js/blob/develop/lib/features/keyboard/KeyboardUtil.js by relying on event.code === 'KeyC' instead for example I believe

Steps to Reproduce

  1. Set your keyboard layout to Ukrainian.
  2. Try to copy/paste elements with the Ctrl+c/Ctrl+v
@Vovamzur Vovamzur added the bug Something isn't working label Aug 22, 2024
@barmac
Copy link
Member

barmac commented Aug 26, 2024

Thanks for your report. This is a known issue for which we have done some research in camunda/camunda-modeler#4080
This all boils down to a need for localisation of the shortcuts. For some languages, the shortcuts rely on the physical location of the key (for them event.code will be an excellent choice), but for others it is the exact key which matters. An example of the latter is the German QWERTZ layout where letter Z is used to trigger undo even though it's located right below the digits.

@barmac barmac added the needs discussion Needs further discussion label Aug 26, 2024
@barmac
Copy link
Member

barmac commented Aug 26, 2024

So right now we support German-style layout well, but seem to miss out for Ukrainian, Russian, and perhaps more.

However, on MacOS, Ukrainian layout works just fine with the existing shortcuts. So it may be platform-dependent. What OS do you use?

@Vovamzur
Copy link
Author

It is reproduced as on Windows as on Ubuntu 22.04. I found this commit c63a452 . Before that change, it worked fine. At least we could just add Ukrainian letters to KEYS_* arrays if there are issues with German

@barmac
Copy link
Member

barmac commented Aug 27, 2024

Thanks for notice. The thing is that even if we add Ukrainian letters, that does not solve the problem of other languages. So we should probably use the physical location, and only support special cases like German separately.

@Vovamzur
Copy link
Author

Hello. Looking forward to the fix. How can I help speed it up? Thanks!

@nikku
Copy link
Member

nikku commented Sep 24, 2024

@Vovamzur Mid-term we want to make the keyboard shortcuts pluggable. As part of your environment, and your usage patterns, you should be able to dynamically change shortcuts.

The complications are well described in this recent thread.

We move this issue to the backlog for now, and consider to make keyboard shortcuts more pluggable in the future.


To workaround this issue today you need to replace the keyboard service and/or related utility methods provided by our tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants