Talk:Howto: AutoHotkey

From EECH Central
Jump to: navigation, search

Lets assume you have 2 joysticks in Game Devices:
1: generic 4 button joystick
2: 4 button gamepad

And assume that we decide that we want these things to happen for our buttons:

Joystick 1, button 1: stable hover hold
Joystick 1, button 2: laser arm/disarm
Joystick 2(gamepad), button 1: Radar Jammer on/off


Steps:

  • download AutoHotKey and install it;
  • open notepad;
  • for the flare, we need to send a SHIFT 'h' keypress, for button 1 on joystick 1.

So type the following in your notepad file:


Joy1::
  Send +h
  return

Joy1 means the first joystick button. The '::' starts your definition. 'Send' means send a keypress. The plus sign (+) represents the shift key. (^ represents CTRL and ! represents ALT) The other control key codes can be found here: http://www.autohotkey.com/docs/Hotkeys.htm

You need to put the 'return' command between buttons in the config file.


  • Next we want to turn the laser on with a '*' keypress.
Joy2::
  Send {NumpadMult}
  return

The {NumpadMult} represents one of the keys on the numberpad. Some of the keys have special codes, which you can find here: http://www.autohotkey.com/docs/KeyList.htm

  • Next we want to turn the radar jammer on with a 'j' keypress.
2Joy1::
  Send j
  return

Here, we need to prefix the joystick number (if you don't provide a leading joystick number, it assumes 1).


  • So the final config looks like this:
Joy1::
  Send +h
  return
Joy2::
  Send {NumpadMult}
  return
2Joy1::
  Send j
  return
  • Save the file to your desktop as "EECH.ahk". Double-click the file to run, and you should see a green H appear in your system tray.

And you're done. Fire up EECH and try it out.

To turn off your config, right-click on the green H in your system tray and click 'Exit'.

You can do a lot of cool things with AutoHotKey, infact I've only scratched the surface. To learn more, you can read the online help, or on their website: http://www.autohotkey.com/docs/