AutoHotkey source code: Send/ControlSend (modifier keys)
Posted: 07 Jan 2017, 11:50
I have been able to understand the AutoHotkey source code for most commands/functions when needed, however the Send/ControlSend source code seems to be rather complicated.
If anyone understands it well, would they please give me or point me to a summary of some of the main issues/techniques.
My main questions are:
- How does AutoHotkey do shift/ctrl/win/alt + letter?
- How can an AutoHotkey GUI detect shift/ctrl/win/alt + letter, i.e. what should it check for in the message queue.
One problem I've had with Send is that if the active window changes, it sends key presses to the wrong window.
So I created 'secure' versions:
Another problem I had is, for example, the euro character would not send properly.
I believe AutoHotkey tries to send (or used to in the past) ctrl+alt+4.
However, WM_CHAR, as used above, seems to work consistently.
Another example is é and ctrl+alt+e.
If anyone understands it well, would they please give me or point me to a summary of some of the main issues/techniques.
My main questions are:
- How does AutoHotkey do shift/ctrl/win/alt + letter?
- How can an AutoHotkey GUI detect shift/ctrl/win/alt + letter, i.e. what should it check for in the message queue.
One problem I've had with Send is that if the active window changes, it sends key presses to the wrong window.
So I created 'secure' versions:
Code: Select all
;send secure (where hWnd is a window/control hWnd):
ControlSend,, % vOutput, % "ahk_id " hWnd
;send raw secure (where hWnd is a window/control hWnd):
Loop Parse, vOutput
PostMessage, 0x102, % Ord(A_LoopField), 1,, % "ahk_id " hWnd ;WM_CHAR := 0x102
I believe AutoHotkey tries to send (or used to in the past) ctrl+alt+4.
However, WM_CHAR, as used above, seems to work consistently.
Another example is é and ctrl+alt+e.