Skip to content Skip to sidebar Skip to footer

Send Key Combination With Python

I want to be able to send the key combination SHIFT + CTRL + . (dot) using the following code: import win32com.client as comclt wsh= comclt.Dispatch('WScript.Shell') wsh.SendKeys()

Solution 1:

For Shift use +

Complete list is available here: SendKeys

... To specify that a combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, create a compound string argument with the modified keystrokes enclosed in parentheses. For example, to send the keystroke combination that specifies that the SHIFT key is held down while:

  • e and c are pressed, send the string argument "+(ec)".
  • e is pressed, followed by a lone c (with no SHIFT), send the string argument "+ec". ...

Post a Comment for "Send Key Combination With Python"