2

I use SharpKeys on my Windows 8 machine to rebind the Caps Lock key to F13 so that I can use it as a hotkey/modifier in other programs. This works fine in Windows applications--for example, http://keycode.info/ correctly reports that I've hit F13 when I press Caps Lock.

However, this does not seem to work in vcxsrv, which treats the key as KP_Enter, i.e. Enter on the numpad. The output from xev is identical regardless of whether I press Caps Lock or the real numpad Enter key. This behavior is not affected by Num Lock, the -keyhook argument to vcxsrv, or the -xkbvariant nodeadkeys argument to vcxsrv, which is everything I could think to try myself. As far as I can tell this is the only key that is not passed through correctly.

In case it matters, I'm using PuTTY to SSH into a Fedora 28 VM to run the X applications I'm using (like xev).

nixtir
  • 21

1 Answers1

0

I ran into this problem with x410 (which is likely a derivative of vcxsrv too). The following isn't a direct answer, but one way of dealing with this via autohotkey:

In you AHK script:

Use some conditions for contexts where you may need these keys:

#HotIf WinActive("ahk_class X410_XAppWin") or WinActive("ahk_exe vncviewer.exe") or WinActive("ahk_exe nxplayer.bin") or ...

inside the condition send a raw key like (and end the block):

*f13:: Send("{Blind}{vk7csc0b7}")
#HotIf

Now use xmodmap to remap the keycode -- put this in a file and feed it as an argument to xmodmap:

keycode 191 = F13 F13

This is all very messy, and uses key codes that I have from some very old context so I can't even remember how I got there. Hopefully someone can find some shred of a better way to do all of this and make into something more organized.

Eli Barzilay
  • 250
  • 2
  • 7