Skip to content

Conversation

PureSpider
Copy link
Contributor

If we do all this work to figure out associated scancodes for virtual keys, we should use them to actually send keystrokes as such.

@oktapodia
Copy link
Collaborator

Thank you for your PR @PureSpider and sorry for the delay, I am struggling to understand exactly what this PR is doing, can you please explain?

@PureSpider
Copy link
Contributor Author

PureSpider commented Nov 24, 2019

Sure:

  • For the method to actually send scan codes, the KEYEVENTF_SCANCODE flag needs to be set. If it is not, the virtual keys method and the associated value is used instead, while the scan code value is ignored.
  • Modifiers and keys should be pressed and released in a more natural order: modifier press, then key press, then key release, then modifier release. Some applications detect shortcuts on the key up instead of the key down event.
  • The time between modifier press and key press should never be zero - some applications struggle to recognize the events correctly if it is. Same goes for key release.

Let me know if you have further questions

@oktapodia
Copy link
Collaborator

Sounds amazing! Thank you! I'll merge it after Appveyor finish its work

@oktapodia oktapodia merged commit 2154a41 into octalmage:master Nov 24, 2019
@oktapodia
Copy link
Collaborator

Thank you for your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants