I want to send virtually the command like this:
when keypress=="a" #if entered key is "a"
send {ALT+TAB} # send ALT and TAB simultaneously
sleep(2) #wait for 2 sec
send {"I love my Country",0.1} #send all strings at 0.1 sec wait
key_down("BACKSPACE",1) #hold down backspace key for 1 sec
send{ALT+F4} #send ALT and F4 simultaneously
For all, or a particular application, also opengl games as well.
I tried SendKeys.py but there is no simultaneously input function and no key_down method for sending holding down a key command. All advice will be greatly appreciated.
I know how to do it with ctypes. For example for Alt-Tab (it is a lot of boilerplate code, I know) :
A modern version would use Unicode :
KEYEVENTF_UNICODE = 0x0004 KEYEVENTF_KEYUP = 0x0002