The script is only doing the barest minimum to send Keydown/Keyup window messages, sending the virtual keycodes, and that's it. Real input has many more fields & events. I don't know how many apps are rejecting the input because of these differences.
For example, Spy++ shows this for pressing the A key:
<000001> 00000000001203BA P WM_KEYDOWN nVirtKey:'A' cRepeat:1 ScanCode:1E fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<000002> 00000000001203BA P WM_CHAR chCharCode:'97' (97) cRepeat:1 ScanCode:1E fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<000003> 00000000001203BA P WM_KEYUP nVirtKey:'A' cRepeat:1 ScanCode:1E fExtended:0 fAltDown:0 fRepeat:1 fUp:1
And here is what the script generates:
<000011> 00000000001203BA S WM_KEYDOWN nVirtKey:'A' cRepeat:0 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<000012> 00000000001203BA R WM_KEYDOWN
<000013> 00000000001203BA S WM_KEYUP nVirtKey:'A' cRepeat:0 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<000014> 00000000001203BA R WM_KEYUP
Differences:
- PostMessage vs. SendMessage
- Repeat flag
- ScanCode
- WM_CHAR events with the character code
The script is only doing the barest minimum to send Keydown/Keyup window messages, sending the virtual keycodes, and that's it. Real input has many more fields & events. I don't know how many apps are rejecting the input because of these differences.
For example, Spy++ shows this for pressing the A key:
And here is what the script generates:
Differences: