'How to simulate keydown events using win32api in python?
Specifically using the keybd_event() function? Do I have to use a while loop to "hold down" the key, or is there a proper way to do this?
Solution 1:[1]
SendInput is better than keybd_event but either way, you tell the function when a key is pressed and call it again to release a key, you don't have to keep calling the function to keep the key pressed.
If possible, consider using UI Automation instead of faking input.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Anders |
