Just use

# from pywinauto.SendKeysCtypes import SendKeys # old for pywinauto==0.5.x
from pywinauto.keyboard import send_keys

send_keys('some text{ENTER 2}some more textt{BACKSPACE}', with_spaces=True)

Docs: https://pywinauto.readthedocs.io/en/latest/code/pywinauto.keyboard.html

P.S. SendKeysCtypes was renamed to keyboard in pywinauto 0.6.0+.

Answer from Vasily Ryabov on Stack Overflow
🌐
Readthedocs
pywinauto.readthedocs.io › en › latest › code › pywinauto.keyboard.html
pywinauto.keyboard — pywinauto 0.6.8 documentation
Example which shows how to press and hold or release a key on the keyboard: send_keys("{VK_SHIFT down}" "pywinauto" "{VK_SHIFT up}") # to type PYWINAUTO send_keys("{h down}" "{e down}" "{h up}" "{e up}" "llo") # to type hello
🌐
Stack Overflow
stackoverflow.com › questions › 50656751 › pywinauto-send-key-down-to-application
python - pywinauto send key down to application - Stack Overflow
from pywinauto.keyboard import SendKeys <...code> SendKeys('{DOWN}') # Keyboard input # in case of element element.type_keys('{DOWN}') ... Sign up to request clarification or add additional context in comments. ... When I say "key down" I mean holding keys down, not down arrow.
Discussions

hold key down to inactive window
There was an error while loading. Please reload this page · instead of holding the key down when I do window.send_keystrokes("{z down}") it presses it once only More on github.com
🌐 github.com
0
October 25, 2020
Press key with pywinauto - Stack Overflow
Extremely straightforward question. Just want to press a keyboard key. Like enter, using pywin auto. I don't want to press it in the context of any application window. Just a raw keypress of a More on stackoverflow.com
🌐 stackoverflow.com
How do i make pywinauto click while holding shift
https://stackoverflow.com/questions/46474508/clicking-a-control-with-modifier-keys-using-pywinauto More on reddit.com
🌐 r/learnpython
6
1
September 3, 2019
Another example for pywinauto
I am new with Windows Automation. I make this pywinauto example for saving time to any newbie like me. My Workflow Open Calculator. Press number and… More on reddit.com
🌐 r/Python
1
3
September 12, 2018
🌐
Readthedocs
airelil-pywinauto.readthedocs.io › en › latest › code › pywinauto.keyboard.html
pywinauto.keyboard — pywinauto 0.6.6 documentation
Example which shows how to press and hold or release a key on the keyboard: send_keys("{VK_SHIFT down}" "pywinauto" "{VK_SHIFT up}") # to type PYWINAUTO send_keys("{h down}" "{e down}" "{h up}" "{e up}" "llo") # to type hello ·
🌐
Readthedocs
pywinauto-fork.readthedocs.io › en › latest › code › pywinauto.keyboard.html
pywinauto.keyboard — pywinauto 0.6.5 documentation
Example which shows how to press and hold or release a key on the keyboard: send_keys("{VK_SHIFT down}" "pywinauto" "{VK_SHIFT up}") # to type PYWINAUTO send_keys("{h down}" "{e down}" "{h up}" "{e up}" "llo") # to type hello
🌐
GitHub
github.com › pywinauto › pywinauto › issues › 997
hold key down to inactive window · Issue #997 · pywinauto/pywinauto
October 25, 2020 - pywinauto / pywinauto Public · Notifications · You must be signed in to change notification settings · Fork 764 · Star 5.8k · New issueCopy link · New issueCopy link · Open · Open · hold key down to inactive window#997 · Copy link ...
Author   vegit0
Find elsewhere
🌐
Reddit
reddit.com › r/python › another example for pywinauto
r/Python on Reddit: Another example for pywinauto
September 12, 2018 - # Another pywinauto example from pywinauto import Desktop, Application, keyboard import time # Open Calculator in Windows 10 and do some calculation app = Application(backend='uia').start("calc.exe") dlg = Desktop(backend="uia").Calculator dlg.type_keys('3') # Add some delay between each key stroke time.sleep(1) dlg.type_keys('/') time.sleep(1) dlg.type_keys('7') time.sleep(1) dlg.type_keys('=') # Get calculation result txt = dlg.Static3.texts() # Get only the numeric value txt = txt[0].split(' ')[2] # Open Notepad from Windows 10 app2 = Application(backend='uia').start("notepad.exe") time.sleep(1) app2.Untitled.edit.type_keys(txt) time.sleep(1) # All {key code} are self explained keyboard.SendKeys('{ENTER}') app2.Untitled.edit.type_keys(u'Automate{SPACE}any{SPACE}Windows{SPACE}Application') keyboard.SendKeys('{ENTER}') app2.Untitled.edit.type_keys(u'BY...{ENTER}Python')
🌐
GitHub
github.com › pywinauto › pywinauto › issues › 503
Implement key down & key up actions in the keyboard module · Issue #503 · pywinauto/pywinauto
June 2, 2018 - This is requested in StackOverflow question: https://stackoverflow.com/questions/50656751/pywinauto-send-key-down-to-application class KeyAction already contains necessary params: down = True, up = True. So just need to use them at a hig...
Author   vasily-v-ryabov
🌐
Read the Docs
app.readthedocs.org › projects › airelil-pywinauto › downloads › pdf › latest pdf
pywinauto Documentation Release 0.6.6 The pywinauto contributors community
July 28, 2006 - pywinauto is a set of python modules to automate the Microsoft Windows GUI. At it’s simplest it allows you to send · mouse and keyboard actions to windows dialogs and controls.
🌐
Radiosky
radiosky.com › rjp3 › rjp3help › sendkeys_reference.html
SendKeys Reference
To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC". To specify repeating keys, use the form {key number}. You must put a space between key and number.
🌐
Readthedocs
pywinauto.readthedocs.io › en › latest › code › pywinauto.base_wrapper.html
pywinauto.base_wrapper — pywinauto 0.6.8 documentation
button is a mouse button to hold during the drag. It can be “left”, “right”, “middle” or “x” · pressed is a key on the keyboard to press during the drag.
🌐
Readthedocs
pywinauto.readthedocs.io › en › uia › code › pywinauto.keyboard.html
pywinauto.keyboard — pywinauto 0.6.0.rc1 documentation
pywinauto.keyboard.SendKeys(keys, pause=0.05, with_spaces=False, with_tabs=False, with_newlines=False, turn_off_numlock=True)¶ ·
🌐
Blogger
electrodone.blogspot.com › 2016 › 08 › pywinauto-basics.html
Electrodone: PyWinAuto-Basics
August 4, 2016 - For convenience, PyAutoGUI provides thepyautogui.press() function, which calls both of these functions to simulate a complete keypress. Run the following code, which will type a dollar sign character (obtained by holding the SHIFT key and pressing ...
🌐
Python Forum
python-forum.io › thread-17735.html
[PyWinAuto] Please help me with Typekeys ()
Hello everyone, I have some code as below: from pywinauto import application from pywinauto import keyboard app = application.Application() app.connect(path= r'C:\Windows\system32\cmd.exe') dlg = app.top_window_() dlg.TypeKeys('cd /d C:\Program Files...
🌐
GitHub
github.com › pywinauto › pywinauto › releases
Releases · pywinauto/pywinauto
January 6, 2025 - Add an ability to hold or release a key with params down and up for .type_keys() method. See the improved docs for keyboard module for more details.
Author   pywinauto