Reputation: 509
I am trying to write a script that duplicates a little bit of what Autohotkey does, because it doesn't work very well for me. I need the script to detect keyboard/mouse-click input to a program, and send different strings/sequence of keystrokes based on the original key pressed. For example if I press mouse middle button, I want to send the three keystrokes 8,9 and 0 in place of the click. All this while some other application is being used. i.e. Torchlight II. Can anyone tell me
I would have used Autohotkey for this but it is acting very unreliably with random unacceptable bugs. I am using python 2.7 64bit, windows 7.
Upvotes: 2
Views: 1108
Reputation: 509
I found the solutions and finished the script. Here are my findings.
1.I got the global keyboard/mouse inputs from Pyhook. Installing it on Python 2.7 amdx64 might be a bit tricky.
2.To send keystrokes/input to an application I used sendkeys-ctypes which works well with python 2.7
Upvotes: 2