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 don't work as expected if keyboard is set to non-latin languages. #2782

Open
iamgabrielma opened this issue Mar 17, 2021 · 3 comments
Labels
bug Something isn't working [feature] shortcuts Anything related to shortcuts i18n All things Internationalization [OS] macOS [OS] windows

Comments

@iamgabrielma
Copy link

iamgabrielma commented Mar 17, 2021

Reported on 3818073-zen

Some hotkeys seem to not work if the keyboard is set to a non-latin language, but they do work if the key mapping is set to English. In this case the user reported the problem for Cyrillic in Windows, but I was able to replicate it as well for Thai in OSX.

I wonder if this could be related to using the latin convention rather than the keyboard key code value, when checking diffs like this one , at cmdOrCtrl && 'KeyT'

Expected

That hotkeys behave equal despite the keyboard layout/language used.

Observed

This behaves differently, when layout is set to Cyrillic some hotkeys work (Ctrl + Shift + I) , but other doesn't, like:

  • Ctrl+/ Show keyboard shortcuts
  • Ctrl+Shift+U Toggle tag list
  • Ctrl+Shift+K Open note above current one, in Cyrilic works like Backspace
  • Ctrl+Shift+J Open note below current one
  • Ctrl+Shift+Y Toggle editing content/tags
  • Ctrl+Shift+L Toggle note list (on narrow screens)
  • Ctrl+Shift+P Toggle Markdown preview

Reproduced

I don't have a Windows machine in order to replicate this specific case, but I replicated the same behaviour for the OSX version, for example in Thai I cannot use cmd+L move focus to search field, while this works if my keyboard is set to Spanish or English.

Details as per the specific user problem:

  • OS: Windows
  • OS version: 10
  • Simplenote app version: 2.7.1
@iamgabrielma iamgabrielma added bug Something isn't working [OS] windows [OS] macOS i18n All things Internationalization labels Mar 17, 2021
@codebykat
Copy link
Member

Yeah, I think we should be using KeyboardEvent.key as per https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code

I swear I've been down this rabbit-hole before. https://github.com/Automattic/simplenote-electron/pull/2334/files

@codebykat
Copy link
Member

Oh, the linked diff is quite old, I think these were all changed in #2334 to use key instead of code, so maybe something else is going on. I don't see any more usages of the old KeyT type constants in the current code.

@codebykat
Copy link
Member

Related: #2040

@codebykat codebykat added the [feature] shortcuts Anything related to shortcuts label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working [feature] shortcuts Anything related to shortcuts i18n All things Internationalization [OS] macOS [OS] windows
Projects
None yet
Development

No branches or pull requests

2 participants