typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

[Feature] Shortcut keys that work with nordic keyboard layouts / other keyboard layouts than English keyboard layout #5494

Open DanielGiljam opened 1 year ago

DanielGiljam commented 1 year ago

Hi,

Currently all shortcut keys don't work if you're keyboard layout is Nordic (Swedish, Finnish, etc.). I think this might also be true for other keyboard layouts besides the English keyboard layout.

I've tried changing shortcut keys, but it doesn't work for me. I'm on macOS and my computer simply ignores whatever configuration I have in "App Shortcuts" for "Typora.app".

Solutions I can think of:

The shortcut key in particular that I'd like to have access to is the shortcut key for toggling "Source Code Mode". Currently, it's unavailable for me as ⌘´ can't be triggered with the Swedish keyboard layout, as the ´ sign requires as modifier, but so does the shortcut key, so I'd have to achieve a logically impossible double in order to trigger the shortcut key.

abnerlee commented 1 year ago

Changing shortcut keys is a macOS provided service, does this work in native apps, like TextEdit.app ?

ADiestelhorst commented 5 months ago

Keyboard handling in OS works on several layers. The lowest layer recieves messages from the hardware and results in messages like the second key from the left in the top row has been pressed. On this layer of the OS the key is represented by a keycode. Unfortunately what is printed on this key differs for keyboards in different countries. So still in the OS this keycode together with the information about modifier keys is mapped to a symbol or keysym.

User applications like Typora must use the fully mapped keysyms and not keycodes. But this is what Typora does. When I want to get Source Code Mode, I have to press ctrl-# on my german keyboard. The Key on american keyboards at this position is ctrl-/, which is the configured shortcut for Source Code Mode.

This type of problem was widespread in the early 1990s, when internationalization was a new thing in software development. I havn't seen this in a long time. Please fix this asap, because it is a major problem for your international customers and it gives a poor impression of software quality.