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 do not work with dvorak #12

Open
skucherenko opened this issue Feb 28, 2024 · 8 comments
Open

hotkeys do not work with dvorak #12

skucherenko opened this issue Feb 28, 2024 · 8 comments

Comments

@skucherenko
Copy link

Looking at the demo page, pressing Option + B (the counter should be bumped) -- nothing happens. Pressing Option + X (it'd correspond to Option + B if I'd use QWERTY and not Dvorak) -- everything works.

Expected: it says Option + B, I press Option + B, it just works
Real: Press Option + B, nothing happens. Frustrating 🤷‍♂️

@ai
Copy link
Owner

ai commented Feb 28, 2024

What event.key and event.code do you have on B/X presses?

What OS do you use and how did you enable Dvorak there?

@skucherenko
Copy link
Author

Just 'B':

{
"key": "x",
"keyCode": 88,
"which": 88,
"code": "KeyB",
"location": 0,
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"repeat": false
}

Option+B:

{
"key": "≈",
"keyCode": 88,
"which": 88,
"code": "KeyB",
"location": 0,
"altKey": true,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"repeat": false
}

macOS Sonoma 14.2.1

Dvorak is set up in a standard macOS way.

image

Karabiner-Elements is installed but it has only simple remappings for external keyboards, nothing that should affect this one.

@ai
Copy link
Owner

ai commented Feb 28, 2024

Can you try to remove this like and check again?

Just 'B':

Is it Dvorak’s B?

@skucherenko
Copy link
Author

skucherenko commented Feb 28, 2024

Can you try to remove this like and check again?

Just 'B':

Is it Dvorak’s B?

Sorry, here it goes:

Dvorak B, QWERTY N:

{
"key": "b",
"keyCode": 66,
"which": 66,
"code": "KeyN",
"location": 0,
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"repeat": false
}

Dvorak X, QWERTY B
{
"key": "x",
"keyCode": 88,
"which": 88,
"code": "KeyB",
"location": 0,
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"repeat": false
}

Works for the second one, I expect it to work on the first one.

@skucherenko
Copy link
Author

Can you try to remove this like and check again?

not sure I understood correctly. Removed NON_ENGLISH_LAYOUT.test(event.key) && check, started locally (pnpm i && pnpm start) -- no luck

@ai
Copy link
Owner

ai commented Feb 28, 2024

Dvorak B, "key": "b",

Seems like it is not a problem with Dvorak.

Does those h hotkeys in demo works in Dvorak (when you press Dvorak’s h)?

@skucherenko
Copy link
Author

Dvorak B, "key": "b",

Seems like it is not a problem with Dvorak.

Does those h hotkeys in demo works in Dvorak (when you press Dvorak’s h)?

Consecutively pressing 'h' in Dvorak and switching tabs with mouse. Looks like expected behavior:

Screen Recording 2024-02-28 at 21 18 20

@ai
Copy link
Owner

ai commented Feb 28, 2024

Hm. Seems like the problem is with Option+B.

  1. Can you show Dvorak’s Option+B event object?
  2. Can you debug those lines to find out why event.code was not used? https://github.com/ai/keyux/blob/main/hotkey.js#L37-L45

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

No branches or pull requests

2 participants