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
- what to use to get the global keyboard input and
- How to send keystrokes to an application?
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.