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

App Shortcut seems to assume QWERTY keymap #191

Open
2 of 5 tasks
guildencrantz opened this issue Apr 29, 2022 · 2 comments
Open
2 of 5 tasks

App Shortcut seems to assume QWERTY keymap #191

guildencrantz opened this issue Apr 29, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@guildencrantz
Copy link

Prerequisites

Expected Behavior

While using the official 1.11.1 package with the system keymap set to dvorak after installation hitting cmd+; should bring up Kit.app (according to the message after installation).

Additionally when changing the app shortcut via Kit.app hitting cmd+; should set the shortcut to cmd+;.

Current Behavior

When the keymap is set to Dvorak Kit.app does not open with cmd+; after installation (it opens with cmd+z: the character which would be on the correct key if the keymap were QWERTY). Nor does it open with cmd+; if the shortcut is set via Kit.app by hitting cmd+; (likewise though the GUI shows the character character, the actual key that gets set is the one which would have that character in QWERTY).

Steps to Reproduce

Below all Hit commands mean "hit the key with this character on your keyboard" and assume you've got a QWERTY keyboard.

  1. Change your app shortcut to cmd+z
  2. Change the keymap to Dvorak
  3. Hit cmd+z
    Kit.app should open.
  4. Open Change App Shortcut
  5. Hit cmd+z
    The GUI should just go back to Run Script
  6. Open Change App Shortcut
  7. Hit cmd+/
  8. Hit T for yes.
  9. Hit cmd+/
    Nothing should happen.
  10. Hit cmd+z
    Kit.app should open.
  11. Change the keymap back to QWERTY
  12. Hit cmd+z
    Kit.app should open.

I haven't validated this, BUT: I'm guessing when you hit the keys to change the shortcut while in Dvorak mode it'll show you the character on the QWERTY key. Having installed with Dvorak it shows the correct Dvorak character. Even when I switch the keymap to QWERTY (so the key map appears to be static from install).

Possible Solution (Not obligatory)

I haven't dug through the code, but it appears that there's a "character to key code" map somewhere that assumes a QWERTY keymap.

Context

This was extremely confusing at first. The dialog after install actually says that cmd+; is the shortcut to open the app, but hitting that didn't do anything (though cmd+z seemed like a sane launch sequence for a QWERTY keymap). It wasn't until I thought about improper key mapping that I tried hitting cmd+/ that I realized the problem.

Now to change the shortcut I have to keep in mind that I need to hit the character for the key that would be in the proper place if I were using a QWERTY keyboard to actually get the proper key set (or I could switch the keymap to QWERTY, then hit the key combo I want).

Your Environment

  • Node version : v10.0.0
  • Kit.app version or branch : v1.11.1
  • Operating System and version : macOS 11.6.5
  • Link to your project :
@guildencrantz guildencrantz added the bug Something isn't working label Apr 29, 2022
@johnlindquist
Copy link
Owner

Hmm, the Mac OS global shortcut api seems to be at fault:

electron/electron#19747 (comment)

I'll put it on the backlog to see if I can detect the user's current keymap (looks like reading a plist file https://stackoverflow.com/a/21613702) and adjust the global shortcut right before registering.

@johnlindquist
Copy link
Owner

Also, as a non-solution, I use karabiner-elements for Colemak instead of using the OSX keymaps. I've never had any problems with keys swapping around. I'm sure there's a karabiner-elements Dvorak map out there if you'd like to give it a try.

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

No branches or pull requests

2 participants