I want to send keys to a background program, but the sending doesn't work on all parts of my program (it has no child windows). The following code partially works.
from pywinauto import Application
appWavie = Application(backend='win32').connect(handle=790164)
Wavie = appWavie['Wavie']
Wavie.send_keystrokes('123')
Is it possible to use the code provided by @lucasg in Keyboard event with ctypes as a pywinauto
method?
I would like to add PressKey
and ReleaseKey
methods to pywinauto
. My code would look like this:
from pywinauto import Application
appWavie = Application(backend='win32').connect(handle=790164)
Wavie = appWavie['Wavie']
VK_1 = 0x31
Wavie.PressKey(VK_1)
Wavie.ReleaseKey(VK_1)
I want to use these methods because they work in my program where send_keystrokes
doesn't work, but PressKey
and ReleaseKey
don't work in the background.