electron / electron/electron

globalShortcuts don't work for alternate keyboards on Mac 10.14.6

Open
#19,747 12 comments 19 reactions 0 assignees View on GitHub
10-x-y 11-x-y 5-0-x 6-1-x 7-0-x 7-1-x 8-x-y 9-x-y bug :beetle: platform/macOS status/confirmed
Dominant language
C++
Stars
123k
Forks
17.5k
Avg merge
14h 31m
Merged PRs (30d)
858

Description

* **Electron Version:**
* 6.0.2
* **Operating System:**
* mac 10.14.6

### Expected Behavior
globalShortcuts work regardless of the chosen keyboard layout

### Actual Behavior
On Mac, globalShortcuts seem to default to either qwerty or the keyboards layout (I think? I don't have a dvorak keyboard) rather than the chosen keyboard layout.

### To Reproduce
Here's a fiddle that I tested on all three platforms. Windows works perfectly, Linux work with a caveat that it doesn't pick up keyboard changes made while the app is running, and Mac is broken.

https://gist.github.com/Kilian/995123ef2e31d6d15ee147a613831bed

To test this, add dvorak to your keyboard layouts. If set to Dvorak, the `l` is in the position of the `p` on a qwerty layout. If you press `ctrl + p` on a physical qwerty keyboard but are using the dvorak layout that should correspond to `ctrl + l` and pressing it should give a console.log in fiddle.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.