-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
macOptionFix: Added support for Mac OS Option + Key presses (Fixes #3197, #3666, #3662, #3284) #4643
base: master
Are you sure you want to change the base?
Conversation
Nicely done. I'd love to get this fixed. I haven't tested this on alternate keyboard layouts, but I think it's safe to say that the approach in this PR only work for English keyboard layouts. I don't think it's scalable to expand the support for this by hard coding the expected key for every available keyboard layout. I'm leaning towards the approach of always ignoring keyboard layout on Mac when the alt key is pressed. Ignoring the keyboard layout for alt key presses on all platforms would probably break some existing configurations, but it shouldn't break existing configurations, because presumably they're already broken given that Alt keybindings currently don't work. Let's leave this open for a bit to see if anyone else wants to chime in. |
@philc, I hear you loud and clear. Try this one on for size! It's confirmed to work on both Mac and Linux (and by "work on Linux" I mean there is no behavior change on that platform as far as I can tell). I've also been considering the potential for breaking existing configurations too - seeing as it was impossible to have both <a-{letter}> and <a-{symbol}> maps in a configuration in the past (at least, not with both working) I think we might be in the clear. There's probably a more in-depth way to handle translating the user maps on the fly rather than which character was read, but any solution that involves the option symbols will need to be locaized. What I've done here is to simply treat any With regards to setting a new (sane) default, my $0.02:
|
…IDE autoformatting
Sorry about that double commit just then... stupid vscode. Edit: I realized just a bit too late that I was showing the wrong Option + Key -> Symbol pair example on the Options page. Last commit of the night, I swear. |
…the night I swear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks like a good fix, although the condition can be simplified. Good job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me.
Description
This PR adds in support for <a-{key}> shortcuts in Vimium on MacOS. On MacOS, when the setting is enabled, Vimium will treat any <a> and <a-{key}> presses as if keyboard layout is ignored, thereby avoiding Mac's øπ†îøñ ߥµ∫ø¬ß (aka option symbols).
My apologies if the style isn't up to snuff - I'm somewhat scrappy and not exactly the most familiar with AirBnB style, but I'm happy to make revisions if you let me know what needs to be addressed!
Should fix #3197
Should fix #3666
Should fix #3662
Should fix #3284