I've been trying to remap an English standard QWERTY layout to a Colemak layout with lots of custom hotkeys for programming.
Most of the remappings have worked fine. The ones that include AltGr as part of a hotkey, however, seem to leave the LCtrl key down after they are used.
Here's an example of the problem:
Lets say I want the keys (e f d s) to behave like the directional arrow keys (Up Right Down Left) respectively while the AltGr key is pressed down.
This is the script I'm using to get that behavior:
Code: Select all
#NoEnv
#Warn
SendMode Input
<^>!e::Send, {Up}
<^>!f::Send, {Right}
<^>!d::Send, {Down}
<^>!s::Send, {Left}
This is the key history given by the script after pressing the AltGr + e and releasing everything.
VK SC Type Up/Dn Elapsed Key
--------------------------------------------------
A2 01D d 8.59 LControl
A5 138 d 0.00 RAlt
45 012 h d 0.27 e
A5 138 i u 0.00 RAlt
A2 01D i u 0.00 LControl
26 148 i d 0.00 Up
26 148 i u 0.00 Up
A5 138 i d 0.00 RAlt
A2 01D i d 0.00 LControl ←
45 012 s u 0.16 e
A5 138 u 0.06 RAlt
The third from last line shows the problem, the last instruction for LControl is down, there should be a corresponding LControl up instruction as the last line in this history.
I have tried changing the SendMode declaration at the top of the page to every other alternative (Event, InputThenPlay, Play) and it didn't help, actually in that case the letters stop working as directional arrows.
I tried adding a {LControl Up} to the commands that are triggered by the hotkeys but this LControl instruction gets inserted in the key history after the Up instructions and before the LControl down instruction that its creating the problem. Basically this two lines get inserted in the previous key history
...idem
26 148 i d 0.00 Up
26 148 i u 0.00 Up
A2 01D i d 0.00 LControl ←
A2 01D i u 0.00 LControl ←
...idem
So the problem remains...
I would greatly appreciate any suggestions about how to prevent the LCtrl key from getting stuck in this scenario, it seems I just need to get that LControl Up instruction in the right place, but it has proven tricky. It is the last piece of the puzzle to have what I consider the perfectly customized keyboard for programming.
If I new the exact instruction that the interpreter is expanding this code <^>!e::Send, {Up} into I would be able to write a function that mimics that behavior inserting the LControl Up instruction where It seems to be missing. Then calling the function with the hotkey would get me what I want.
Thanks for any pointers. The forum has many references to LCtrl getting stuck after using AltGr but none of the ones I found seem to solve my issue or perhaps I'm not experienced enough to make use of them. I don't mind working on my own if you think you can point me to the right part of the documentation or to another post that solves the problem and tell me off for not looking close enough that is fine too and I may very well deserve it.