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

Doesn't seem to respect keyboard layout #93

Closed
Nikki1993 opened this issue Jan 2, 2024 · 7 comments
Closed

Doesn't seem to respect keyboard layout #93

Nikki1993 opened this issue Jan 2, 2024 · 7 comments
Milestone

Comments

@Nikki1993
Copy link

I am running Dvorak layout but it appears keybinds are executed as if I am running QWERTY layout. Is there a possibility to make AeroSpace respect keyboard layout set or do I have to rebind all keys in such a way that when I press ALT+R (Dvorak) it will execute ALT+O (QWERTY) keybind?

@nikitabobko
Copy link
Owner

nikitabobko commented Jan 2, 2024

AeroSpace uses https:/soffes/HotKey dependency to manage global keys. I managed to find this issue in their repo soffes/HotKey#2, it looks like the problem you mention

Frankly speaking, the experience with HotKey library wasn't smooth during the development, plus the HotKey library doesn't support left/right modifiers, and AeroSpace has random bugs with hotkeys handling

Maybe I'm using the library incorrectly, but whatever.

I want to try to replace this dependency with something else and see how it goes. Hopefully, it will fix the Dvorak issue

@hrvstr
Copy link

hrvstr commented Jan 3, 2024

It's the same for international keyboard layouts (e.g. German). When mapping keys I have to keep an image of a US keyboard open. So when I see in the config:

alt-shift-minus = 'resize smart -50'
alt-shift-equal = 'resize smart +50'

The app is actually listening on alt-shift-questionmark and alt-shift-backtick.

@nikitabobko nikitabobko added this to the 0.9.0-Beta milestone Jan 25, 2024
@nikitabobko nikitabobko removed this from the 0.9.0-Beta milestone Feb 7, 2024
nikitabobko added a commit that referenced this issue Feb 18, 2024
@ELLIOTTCABLE
Copy link

I saw the work on this, but it looks like you force-pushed over it 😅

Any chance we could get a testing-release with the fix?

@nikitabobko nikitabobko added this to the 0.9.0-Beta milestone Mar 9, 2024
nikitabobko added a commit that referenced this issue Mar 9, 2024
@nikitabobko
Copy link
Owner

0.9.0 addresses the issue. See https://nikitabobko.github.io/AeroSpace/guide#key-mapping

The project now also accepts funding https:/sponsors/nikitabobko

@nikitabobko
Copy link
Owner

Elaboration

Apple API speaks in terms of key-codes. Key-code q is a key next to the tab key. If we wanted to automatically support layouts, then we'd need to subscribe for keyboard layouts changes (if Apple provides an API for it). When the keyboard layout changes, we'd need to translate key notations to key codes (if Apple provides an API for it), and "remap" our subscriptions for key codes

And I don't even want to think what happens with non-Latin layouts, or when users have several Latin layouts

There are so many places where anything can go wrong with an automatic approach. That's why I think, it's more reliable to give users a way to remap keys manually

Apparently, skhd resolved these issues somehow, but I'm not going through this rabbit hole

@eproxus
Copy link

eproxus commented Jun 8, 2024

(Let me know if I should open a new issue for this)

Thanks for a great tool!

I'm trying to get alt-slash to work on a custom Dvorak layout and it just doesn't seem to trigger. Alt+/ works fine in Hammerspoon, but AeroSpace doesn't recognize it. In an editor, if I press Alt+/ a ÷ is inserted (because that is how the keyboard layout is defined) but many other programs detects it properly.

Are there plans to fix issues like these in AeroSpace or are they effectively closed as "wont fix"?

I'll try to see if I can combine it with skhd but it would be great if it worked out of the box.

@lknop
Copy link

lknop commented Jun 13, 2024

I would go with skhd. Aerospace is using a high-level api and gets the keycodes it gets. Without migrating to a different hotkey library this issue is likely unsolveable. If other software is able to match the keys for you I think it's safer to use it rather than rewriting that part of aerospace.

jakenvac pushed a commit to jakenvac/AeroSpace that referenced this issue Aug 16, 2024
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

6 participants