Difference between revisions of "Macros"
(Marked this version for translation) |
|||
Line 1: | Line 1: | ||
<languages /> | <languages /> | ||
− | <translate>It's possible to configure keyboard/mouse/joystick macros: a key or button press can trigger a series of keyboard/mouse/joystick events, with timing conditions. | + | <translate><!--T:1--> |
+ | It's possible to configure keyboard/mouse/joystick macros: a key or button press can trigger a series of keyboard/mouse/joystick events, with timing conditions. | ||
− | ==Directory== | + | ==Directory== <!--T:2--> |
+ | <!--T:3--> | ||
Macros have to be defined in files saved into: | Macros have to be defined in files saved into: | ||
* Ubuntu: the ~/.emuclient/macros directory. ~ is the home directory, and .emuclient folder is hidden (in the file manager, press ctrl+h to display hidden folders). | * Ubuntu: the ~/.emuclient/macros directory. ~ is the home directory, and .emuclient folder is hidden (in the file manager, press ctrl+h to display hidden folders). | ||
Line 9: | Line 11: | ||
* Windows 64bits: the C:\Program Files (x86)\GIMX\macros directory. | * Windows 64bits: the C:\Program Files (x86)\GIMX\macros directory. | ||
− | ==Syntax== | + | ==Syntax== <!--T:4--> |
− | MACRO <DEVICE EVENT> <ID> | + | <!--T:5--> |
+ | MACRO <DEVICE EVENT> <ID> | ||
<DEVICE EVENT> <ID> | <DEVICE EVENT> <ID> | ||
DELAY <MS> | DELAY <MS> | ||
#<COMMENT> | #<COMMENT> | ||
− | <DEVICE EVENT>: KEYDOWN, KEYUP, MBUTTONDOWN, MBUTTONUP, JBUTTONDOWN, JBUTTONUP | + | <!--T:6--> |
+ | <DEVICE EVENT>: KEYDOWN, KEYUP, MBUTTONDOWN, MBUTTONUP, JBUTTONDOWN, JBUTTONUP | ||
<ID>: the event id (case sensitive) as displayed in gimx-config | <ID>: the event id (case sensitive) as displayed in gimx-config | ||
<MS>: integer value in milliseconds | <MS>: integer value in milliseconds | ||
<COMMENT>: a comment, not interpreted | <COMMENT>: a comment, not interpreted | ||
− | ==Commands== | + | ==Commands== <!--T:7--> |
+ | <!--T:8--> | ||
* KEYDOWN: keyboard key pressed | * KEYDOWN: keyboard key pressed | ||
* KEYUP: keyboard key released | * KEYUP: keyboard key released | ||
* KEY: KEYDOWN + DELAY 50 + KEYUP | * KEY: KEYDOWN + DELAY 50 + KEYUP | ||
+ | <!--T:9--> | ||
* MBUTTONDOWN: mouse button pressed | * MBUTTONDOWN: mouse button pressed | ||
* MBUTTONUP: mouse button released | * MBUTTONUP: mouse button released | ||
+ | <!--T:10--> | ||
* JBUTTONDOWN: joystick button pressed | * JBUTTONDOWN: joystick button pressed | ||
* JBUTTONUP: joystick button released | * JBUTTONUP: joystick button released | ||
+ | <!--T:11--> | ||
* DELAY: delay in milliseconds | * DELAY: delay in milliseconds | ||
− | ==Example: rapid_fire.txt== | + | ==Example: rapid_fire.txt== <!--T:12--> |
− | MACRO MBUTTONDOWN BUTTON_LEFT | + | <!--T:13--> |
+ | MACRO MBUTTONDOWN BUTTON_LEFT | ||
KEYDOWN p | KEYDOWN p | ||
DELAY 50 | DELAY 50 | ||
Line 48: | Line 57: | ||
MBUTTONDOWN BUTTON_LEFT | MBUTTONDOWN BUTTON_LEFT | ||
+ | <!--T:14--> | ||
'p' is bind to r1 in both hip fire and ADS profiles.<br/> | 'p' is bind to r1 in both hip fire and ADS profiles.<br/> | ||
'BUTTON_LEFT' is NOT bind to r1 in both hip fire and ADS profiles. | 'BUTTON_LEFT' is NOT bind to r1 in both hip fire and ADS profiles. | ||
− | ==Notes== | + | ==Notes== <!--T:15--> |
− | ===Macro loop=== | + | ===Macro loop=== <!--T:16--> |
+ | <!--T:17--> | ||
To make a macro loop, just add a KEYDOWN or MBUTTONDOWN or JBUTTONDOWN command at the end of the macro definition.<br/> | To make a macro loop, just add a KEYDOWN or MBUTTONDOWN or JBUTTONDOWN command at the end of the macro definition.<br/> | ||
Example: | Example: | ||
Line 67: | Line 78: | ||
To stop a macro loop, just press the trigger again. The macro is stopped immediately, and the state of the controller is unchanged. | To stop a macro loop, just press the trigger again. The macro is stopped immediately, and the state of the controller is unchanged. | ||
− | ===Multiple keyboards/mice/joysticks=== | + | ===Multiple keyboards/mice/joysticks=== <!--T:18--> |
+ | <!--T:19--> | ||
In case multiple keyboards or mice or joysticks are used, it's not possible to specify the device for which events are generated.<br/> | In case multiple keyboards or mice or joysticks are used, it's not possible to specify the device for which events are generated.<br/> | ||
Events are generated for the first keyboard/mouse/joystick found in the configuration. | Events are generated for the first keyboard/mouse/joystick found in the configuration. | ||
</translate> | </translate> |
Revision as of 14:10, 27 June 2012
It's possible to configure keyboard/mouse/joystick macros: a key or button press can trigger a series of keyboard/mouse/joystick events, with timing conditions.
Contents
Directory
Macros have to be defined in files saved into:
- Ubuntu: the ~/.emuclient/macros directory. ~ is the home directory, and .emuclient folder is hidden (in the file manager, press ctrl+h to display hidden folders).
- Windows 32bits: the C:\Program Files\GIMX\macros directory.
- Windows 64bits: the C:\Program Files (x86)\GIMX\macros directory.
Syntax
MACRO <DEVICE EVENT> <ID> <DEVICE EVENT> <ID> DELAY <MS> #<COMMENT>
<DEVICE EVENT>: KEYDOWN, KEYUP, MBUTTONDOWN, MBUTTONUP, JBUTTONDOWN, JBUTTONUP <ID>: the event id (case sensitive) as displayed in gimx-config <MS>: integer value in milliseconds <COMMENT>: a comment, not interpreted
Commands
- KEYDOWN: keyboard key pressed
- KEYUP: keyboard key released
- KEY: KEYDOWN + DELAY 50 + KEYUP
- MBUTTONDOWN: mouse button pressed
- MBUTTONUP: mouse button released
- JBUTTONDOWN: joystick button pressed
- JBUTTONUP: joystick button released
- DELAY: delay in milliseconds
Example: rapid_fire.txt
MACRO MBUTTONDOWN BUTTON_LEFT KEYDOWN p DELAY 50 KEYUP p DELAY 50 MBUTTONDOWN BUTTON_LEFT MACRO MBUTTONUP BUTTON_LEFT KEYUP p MBUTTONDOWN BUTTON_LEFT
'p' is bind to r1 in both hip fire and ADS profiles.
'BUTTON_LEFT' is NOT bind to r1 in both hip fire and ADS profiles.
Notes
Macro loop
To make a macro loop, just add a KEYDOWN or MBUTTONDOWN or JBUTTONDOWN command at the end of the macro definition.
Example:
MACRO MBUTTONDOWN BUTTON_LEFT KEYDOWN p DELAY 50 KEYUP p DELAY 50 MBUTTONDOWN BUTTON_LEFT
The macro is triggered by pressing 'BUTTON_LEFT'.
The last command of the macro restarts the macro, creating a loop.
To stop a macro loop, just press the trigger again. The macro is stopped immediately, and the state of the controller is unchanged.
Multiple keyboards/mice/joysticks
In case multiple keyboards or mice or joysticks are used, it's not possible to specify the device for which events are generated.
Events are generated for the first keyboard/mouse/joystick found in the configuration.