oni2
oni2 copied to clipboard
AutoHotKey: Onivim not respecting Control / Alt re-maps
Pulled out from #557 to track - it seems that Onivim is not respecting Control
and Alt
remaps - making it unusable.
From @ianelletson 's comments:
I use Microsoft Powertools (formerly autohotkey) to remap my CTRL and ALT on my keyboard. Omnivim doesn't detect these remaps nor does it detect the keys' original keycodes. This means no shortcuts work, at all, rending Omnivim entirely unusable.
@ianellettson - would it be possible to see the AutoHotKey / Powertools script you are using (specifically, those remaps?) Would like to see if I can reproduce it.
Thank you, @bryphe I appreciate it! Here are the relevant lines from the .ahk script:
LAlt::Ctrl
LCtrl::Alt
I have tried both those remaps and the following in PowerToys' keyboard manager:
From PowerToys (n.b. I erroneously referred to them as Powertools in the original post)
Thanks for the details, @ianelletson !
I got a chance to test this a bit today - using AutoHotKey, I ran this script:
LAlt::Ctrl
LCtrl::Alt
Surprisingly - this actually worked for me!
I ran the autohotkey script as administrator, and then in both Onivim 2 ran as administrator and non-admin - the following mapped key presses worked:
- Alt+P (Ctrl+P -> open quick-open file picker)
- Alt+C (Ctrl+C in insert mode -> switch to normal mode)
- Alt+V (Ctrl+V in insert mode -> paste)
...however - I'm running a pretty old AHK I think (1.1.30.01) - would be curious what version you're using @ianelletson to get a more apples to apples comparison? I'm also wondering - do you run AHK as an administrator?
Using PowerToys, I had different results - simple ASCII remaps worked (a -> b), but the Control/Alt bindings in PowerToys did not work with Onivim. I tried multiple configurations - running PowerToys as administrator, running Onivim, restart the keymap, etc. I ran it against a test app with SDL, and SDL's input layer wasn't picking up the Control/Alt key presses at all. It looks like the input strategy SDL uses might not be compatible with PowerToys, so that might take a bit more digging.
Do you use both AHK and PowerToys at the same time, @ianelletson ?
PowerToys issue might be related to this: https://github.com/microsoft/PowerToys/issues/4012 - but it's curious that AHK seems to work in my testing
Hope you enjoyed the weekend! I do use both AHK (I no longer run it as admin due to workplace policy changes) and PowerToys at the same time, though only one or the other for remapping CTRL/ALT.
I'm on 1.1.32 and I made a new script for AHK that is confined to exactly the remaps I sent you, which does appear to work for Onivim! Fantastic! However the AHK remap seems to clobber my alt+tab behavior, whereas PowerToys does not.
I really appreciate your investigation. It seems like this is related to the PowerToys bug.
PowerToys issue might be related to this: microsoft/PowerToys#4012 - but it's curious that AHK seems to work in my testing
I'm not a Onivim on Windows user, but this issue drew my attention. It appears the PowerToys-issue got closed, so it might be worth retesting this behavior.