susam / uncap

Map Caps Lock to Escape or any key to any key
MIT License
1.07k stars 44 forks source link

Does this works for wsl(Windows Subsystem for linux)? #1

Closed tclh123 closed 6 years ago

tclh123 commented 6 years ago

I want to map capslock to control on wsl(ubuntu). But loadkeys will report Couldn't get a file descriptor referring to the console.

tclh123 commented 6 years ago

I believe it works.

pfeiferbit commented 6 years ago

What have you done to make it work?

I had a setup with MSYS2 where I put uncap.exe in MSYS2's /usr/local/bin and then put

uncap 0x1b:0x14 &

into my ~/.bash_profile. That way I had ESC switched with CAPS LOCK when I had at least one MSYS2 shell open, i.e. when I was developing something, but no more uncap running when the last MSYS2 shell was closed.

I want to emulate the same behavior with WSL now but when running uncap 0x1b:0x14 I get the following output:

/usr/local/bin/uncap: Invalid argument
tclh123 commented 6 years ago

@pfeiferbit I use AutoHotKey, not really test this uncap.exe util. But I think their principle is the same. I think you should use it in the windows shell - cmd.exe, not MSYS2 environment. If the mapping works in windows environment, then it should work when you use MSYS2.