Remapping of LWin and LAlt
Posted: 11 May 2024, 06:46
Probably some sort of FAQ but I just cannot figure it out. So, I have this special keyboard.
1. LWin and LAlt are in the wrong place and need to be swiched. So far this works quite well:
2. That keyboard has a builtin hotkey that sends a LWin+LShift+4 combination, and I would like to capture this and do something about it.
However, due to the above rules, there can be two different flows of events:
Either, LWin (triggers hook) then LShift (nornal) then LAlt (ignored, from hook) then 4 (normal) = I could handle it with +!4
Or, LWin (triggers hook) then LShift (normal) then 4 (normal) then LAlt (ignored, from hook) = Alt comes too late
I get it that there is a race condition due to the speed at which the hook triggers.
But I cannot figure out how to deal with this.
Ideas?
1. LWin and LAlt are in the wrong place and need to be swiched. So far this works quite well:
Code: Select all
LWin::LAlt
LAlt::LWin
However, due to the above rules, there can be two different flows of events:
Either, LWin (triggers hook) then LShift (nornal) then LAlt (ignored, from hook) then 4 (normal) = I could handle it with +!4
Or, LWin (triggers hook) then LShift (normal) then 4 (normal) then LAlt (ignored, from hook) = Alt comes too late
I get it that there is a race condition due to the speed at which the hook triggers.
But I cannot figure out how to deal with this.
Ideas?