How can you simulate keyboard key presses so that, for example, by running the corresponding script, the specified text itself is typed in a third-party program? However, it is more interested in emulating keyboard shortcuts, and not character or digital, but such as CTRL or SHIFT. Cross-platform is not important.
1 answer
The pyautogui module helped (a little about it here ). Unfortunately it does not support the Cyrillic alphabet, but in my case this is not a problem.
|
SendInput()API. The only drawback of pyautogui in comparison with SendKeys is that the pillow is an addiction, as well as some advantages: it is also simple, but portable, and supports not only the keys. - jfs