There are two keys adjacent to the spacebar on standard Korean keyboards (one on each side) which I would like to remap to be Control or Alt modifiers - so I can alternate using a stronger finger than my pinky (I'm an emacs user).
I'm guessing the problem is that they do not seem to generate a KeyUp event, and they don't repeat like other keys. I've got a hacky solution that is terrible involving a loop using autohotkey. Also did something similar with another non-free program, KeyManager. I'm hoping for some more advanced trickery or workarounds (AutoHotkey, drivers or otherwise).
;Scan Code for Hanja Key
sc1F1::
Loop 10000
{
SetKeyDelay,-1
Send {Blind}{LCtrl DownTemp}
}
SetKeyDelay,-1
Send {Blind}{LCtrl Up}
Return
Keyboard Hook Output of Pressing (and holding) Hanja:
You can see there is no repeat and no up event.
VK SC Type Up/Dn Elapsed Key Window
74 03F u 0.08 F5
19 1F1 d 0.66 Hanja
74 03F d 9.58 F5
Updates:
Tried:
sc1F1 & t::Send {Blind}{LCtrl DownTemp}{t}{LCtrl Up}
Results:
After pressing Hanja+t, the hotkey fires, but then subsequent presses of ONLY t alone perform the same action. LCtrl Up
doesn't appear to occur.
Abe's SetTimer
based reset is nice though! feels like a more elegant version of my original code. However, the catch is the delay - I have to pace my input speed to match the delay.
Other tested solutions:
GetKeyState("vk19", "p")
always reports PRESSED after script loads and one initial press. It never breaks this state - even long after i have released the key.
KeyWait
also doesn't work as intended.
sc1F1 up::traytip,, test
also does not produce a traytip after any number of press/releases.