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

Solve AltGr deadkey problem on macOS #97

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

apr3vau
Copy link
Contributor

@apr3vau apr3vau commented Jan 30, 2025

Apple enables AltGr dead-key function arbitrarily for both Option keys on macOS, and users cannot disable this behavior. It corrupts all input-related key bindings using Option/Alt/Meta on every macOS software, and every editor & terminal emulator needs to deal with this fucking problem, or you have to remap all your keys from M-a to M-å, etc.

There're two popular solutions. One is using Command instead of Option, this will hurt those who love macOS global shortcuts; Another is reading hardware keycode directly to abandon the AltGr conversion, this will only hurt some Europeans. These solutions exist in many software, like emacs-plus & emacs-mac, iTerm2, kitty, etc.

I implemented the latter one in this commit. It makes me able to use any M & C-M-related bindings on macOS. Note that this is only a temporary/partial solution, as the keycode facility in JS web api can possibly disregard the keyboard layout settings, so those who are using Dvorak/Colemak/UK keyboards may need further setups.

I hope you can find it useful, but feel free to reject / edit this PR if you don't like the solution.

@apr3vau
Copy link
Contributor Author

apr3vau commented Jan 30, 2025

Oh, I found #87 mentioned this issue. Hopefully you can close that issue as solved after this patch.

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

Successfully merging this pull request may close these issues.

1 participant