Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Markdown keyboard shortcuts in textboxes map to incorrect keys in Dvorak keyboard layout #981

Closed
richardxia opened this issue Jul 25, 2017 · 1 comment

Comments

@richardxia
Copy link

The JavaScript used for Markdown keyboard shortcuts in textboxes seems to not respect different keyboard layouts and will conflict with the browser/OS cut and copy shortcut commands when on the Dvorak keyboard layout.

I'm using macOS 10.11 with Chrome 59, and I've noticed that when I try to hit Cmd + x or Cmd + c for cut and copy respectively, it instead triggers the bold and italicize Markdown shortcuts. This is because the physical key on my keyboard with a "B" printed on it maps to "X" in Dvorak, and "I" maps to "C". When I hit Cmd + (physical key B/"virtual" key X) for the cut command in Dvorak, it appears that the Javascript interprets it as Cmd + B and surrounds my highlighted text with ** ** in order to bold it. I assume that the JavaScript is looking at the physical key code rather than the "virtual" key code.

I'm not knowledgable on how key codes is actually implemented at the OS level and how it is exposed to user-level programs/JavaScript running in a browser, but this ticket seems to have an extremely detailed description of how it works on various OSs.

@richardxia
Copy link
Author

GitHub support got back to me and let me know that this is actually a recent bug in Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=747358

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant