ililim / dual-key-remap

Remap any key to any other two keys on Windows 🔥. Remap CapsLock to both Ctrl and Escape! (It's like xcape for windows!)
GNU General Public License v2.0
491 stars 35 forks source link

<CAPSLOCK> and <ESC> not registered in certain programs #7

Closed mawkler closed 4 years ago

mawkler commented 5 years ago

I have binded CAPSLOCK to ESC when tapped and CTRL when combined with other key like so:

remap_key=VK_ESCAPE
when_alone=VK_ESCAPE
with_other=VK_CONTROL

This works in most applications. However, in some games (e.g. League of Legends), both CAPSLOCK and ESC are dead, i.e. they do nothing when pressed.

Turning off dual-key-remap.exe enables these keys again.

ililim commented 5 years ago

Does this happen with any programs that are not League of Legends? If so, could you list them? I'll try to debug the common theme and to see what the issue is. Note that at this time the app doesn't work (yet) with anything that's run as administrator.

After some reading it seems that League of Legends is notorious for not being compatible with software that modifies keyboard inputs (AutoHotkey doesn't work well either). I assume this has to do with their anti-bot/cheat measures, which inadvertently ends up breaking legitimate tools also.

A potential improvement for this tool would be registering a menubar item that allows the user to temporarily disable the utility, so the they can use the normal keyset for certain applications. Or even better an application blacklist.

mawkler commented 5 years ago

I haven't had the time to try out that many games, but here are a couple of games that don't register ESC with dual-key-remap.exe running:

shawjak3 commented 5 years ago

Another program that this happens to is Visual Studio Code. I use vim and was really wanting to use this but once I run this my capslock and escape are both dead.

ililim commented 5 years ago

@shawjak3 I use dual-key-remap with VS Code also and it works for me. Do you run Visual Studio Code as administrator? If you do then dual-key-remap must also run as administrator (see #1).

shawjak3 commented 5 years ago

@ililim I have tried both ways in both programs and it just makes capslock and escape do nothing system wide.

Konfekt commented 5 years ago

dual-key-remap works fine over here, but in such instances, it might be interesting to use the various autohotkey scripts such as

https://gist.github.com/sedm0784/4443120

and

https://github.com/fenwar/ahk-caps-ctrl-esc

as a fallback and report if they work fine.

shawjak3 commented 5 years ago

@Konfekt I have tried those as well and I get the same behavior results; escape and capslock just don't work at all.

ililim commented 5 years ago

Good call on testing AHK @Konfekt.

@shawjak3 What version of OS are you running and do you use any other applications that modify keyboard input in any way? Autohotkey and dual-key-remap use the same Windows API to modify keyboard input, so the underlying cause is probably the same for both apps.

shawjak3 commented 5 years ago

@ililim I'm running a fresh install of Windows 10 Home. I have no other applications that modify keyboard input. Those were the only 2 I tried and they behaved the same way. Makes sense to me if they use the same API underneath because I get exactly the same results.

I'm trying to get used to jj for esacpe in vim in the meantime...really missing my capslock for escape haha. But I realize you guys do this as a help and on your own time so thanks for your time and help.

Konfekt commented 5 years ago

I am currently out of ideas other than recommending https://github.com/kana/vim-arpeggio as an alternative to jj inside Vim in the meanwhile.

Konfekt commented 5 years ago

Perhaps try a different keyboard layout, driver or, to test, switch the physical keyboard.

shawjak3 commented 5 years ago

@Konfekt I tried a Corsair keyboard and the built in keyboard on my laptop and I get the same results. Thanks for all your suggestions guys, I'll keep checking back periodically to see if someone finds a fix or workaround.

shawjak3 commented 5 years ago

Hey guys I wanted to report back and say that I had a keybinding I put in my vscode that mapped escape and capslock to escape in vim on linux that I carried over. Turns out that was interfering with this program. I removed those and it now works perfectly.

ililim commented 4 years ago

Move game specific discussion into it's own issue: https://github.com/ililim/dual-key-remap/issues/25