Search code examples
pythonpython-3.xpywin32pywinautopywin

Pywinauto keyboard not recognizing double letters


I am trying to type shortcut ALT + C + C, but only takes first letter ALT + C which in code translates:

processId = 0
try:
    app.connect(process=processId)
except:
    print("issue not found")
win = app.window(top_level_only=False, visible_only=False, found_index=0)
winUia = win.wrapper_object()
winUia.type_keys("{VK_MENU down}CC{VK_MENU up}", set_foreground=True, pause=.5, vk_packet=False, with_spaces=True)

Solution

  • Managed to do it like

    winUia.type_keys("{VK_MENU down}(CC 2){VK_MENU up}", set_foreground=True, pause=.5, vk_packet=False, with_spaces=True)