Skip to content

Better emulation of real WM_ messages #5

@WhazzItToYa

Description

@WhazzItToYa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions