Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''I now have it where I can use the Windows key, except it doesn't work in combination with letters (but it does work with the other keys like the "right arrow").'''
- import win32com.client as comclt
- from win32api import *
- from win32con import *
- def SendKeys(string):
- wsh= comclt.Dispatch("WScript.Shell")
- if "{WIN}" in string:
- keybd_event(VK_LWIN,0,KEYEVENTF_EXTENDEDKEY, 0)
- nonWin = string[string.index("{WIN}")+len("{WIN}"):]
- wsh.SendKeys(nonWin)
- keybd_event(VK_LWIN,0,KEYEVENTF_KEYUP,0)
- else:
- wsh.SendKeys(string)
- return
- #For example, calling:
- SendKeys("{WIN}{RIGHT}")
- #will snap the current window to the right.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement