Remapping a Joystick to Keyboard or Mouse
Important Notes
Although a joystick button or axis can be remapped to become a key or mouse button, it cannot be remapped to some other joystick button or axis. That would be possible only with the help of a joystick emulator such as PPJoy.
AutoHotkey identifies each button on a joystick with a unique number between 1 and 32. To determine these numbers, use the joystick test script.
Making a Joystick Button Send Keystrokes or Mouse Clicks
Below are three approaches, starting at the simplest and ending with the most complex. The most complex method works in the broadest variety of circumstances (such as games that require a key or mouse button to be held down).
Method #1: This method sends simple keystrokes and mouse clicks. For example:
Joy1::Send {Left} ; Have button #1 send a left-arrow keystroke.
Joy2::Click ; Have button #2 send a click of left mouse button.
Joy3::Send a{Esc}{Space}{Enter} ; Have button #3 send the letter "a" followed by Escape, Space, and Enter.
Joy4::Send Sincerely,{Enter}John Smith ; Have button #4 send a two-line signature.
AutoHotkey is a free, open-source utility for Windows. With it, you can:
Automate almost anything by sending keystrokes and mouse clicks. You can write macros by hand or use the macro recorder.
Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".
Create custom data entry forms, user interfaces, and menu bars. See GUI for details.
Remap keys and buttons on your keyboard, joystick, and mouse.
Respond to signals from hand-held remote controls via the WinLIRC client script.
Run existing AutoIt v2 scripts and enhance them with new capabilities.
Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed.
Getting started might be easier than you think. Check out the quick-start tutorial.
http://www.autohotkey.com/