
Gamepad / Joystick Trigger
The Gamepad/ Joystick Trigger allows you to make use of gamepad and joystick controllers in your experimental design as an input device for recording data.
Table of Contents
Overview
The trigger listens to a connected gamepad or joystick and fires whenever a button is pressed or released, an axis (stick) moves, or both. It is found in the trigger selection menu of the Event System.
Note: the trigger only works once the integration is switched on. Go to Settings → Special Features → Gamepad Integration and enable it, as described in the Settings page.
Useful Demo: Check out this demo that shows the basic setup for gamepad and joystick input.

Common Use Cases
The Gamepad/ Joystick Trigger suits tasks where a controller replaces the keyboard or mouse as the response device.
- Button-press responses: record which button a participant pressed, and when, for choice or reaction time tasks.
- Continuous control: use stick movement to drive an on-screen object or to record a continuous response, such as steering or tracking.
- Alternative input device: offer participants who find a keyboard or mouse difficult to use a controller instead.
How It Works
To access the Gamepad/ Joystick Trigger, open the Event System in the Task Editor and create a new event. Select Gamepad/Joystick from the trigger menu. The following dialog box then appears.

The trigger can listen for buttons, for axes, or for both at once. The table below explains each option.
| Menu Item | Menu Area | Gamepad / Joystick Trigger Options |
|---|---|---|
Listen for buttons | ![]() | Checked by default. When checked, the trigger reacts to button input and shows the two options below. I.) Trigger on: sets which button action fires the trigger: Press Key, Press OR Hold Key, or Release Key. With Press Key, a key must be released before it can fire again. With Press OR Hold Key, pressing and holding fires the trigger continuously. Release Key fires when a key is let go.II.) Buttons: sets whether the trigger reacts to Any button or only Specific ones. With Specific, use the Add button and press the button(s) on your gamepad to add them to the list. Use Cancel to stop listening, and the cross next to a button's ID to remove it. |
Listen for axes | ![]() | Unchecked by default. When checked, the trigger fires whenever an axis value changes by more than the threshold value. The threshold can be set between -1 and 1 in steps of 0.01, and the default value is 0.01. |
| Connection status | ![]() | Indicates whether a device is connected or not. |
| Live data stream | ![]() | Upon connecting the device and pressing a key or moving an axes, then the live data will be displayed where any input you make on your device will be displayed here. This is useful for testing when setting up your study and determining which keys or axes you want to utilize. |
Upon connecting your gamepad, you can specify what specific keys should be used as triggers. Upon pressing the particular key, the system will display its ID.
In the example below the 2 refers to the ◎ key and 3 refers to the ▵ key. Note: It’s important to say that there is some variation between game pads in how key ID assignment works.

As a result of pressing a key, the live data will also appear in the second half of this trigger dialog box where you can see how the values change in real-time based on what you press or release:

Take a look at this walkthrough for more details and an example of a study that utilizes this trigger.
Trigger-Specific Values for Gamepad / Joystick
After selecting the Gamepad/ Joystick Trigger in the event system, you can reference the following trigger-specific values across various actions with the Value-Select Menu.

| Trigger (Gamepad/ Joystick) Options | Description |
|---|---|
Gamepad Device Id | The ID or name of the gamepad that was connected. |
Pressed Keys Once (Array) | The keys that were pressed. A held key is not counted again until it has been released. |
Pressed Or Hold Keys (Array) | The keys that were pressed or held. |
Released Keys (Array) | The keys that were released. |
Axes (Array) | The axes values. |
Gamepad Timestamp (Unixtime) | The gamepad timestamp in Unixtime. |
Trigger Timestamp (Unixtime) | Timestamp of when the trigger occurs in Unixtime. |
Trigger Time (From Frame Onset) | Time in milliseconds from the frame onset to when the trigger occurred. |
Workflow Tips
- Test with the live data stream first. Connect the gamepad, press every button you plan to use, and note the IDs before building the event. Key IDs differ between gamepad models, so a study built on one controller may need its IDs rechecked on another.
- Choose the right
Trigger on:option. UsePress Keywhen each press should count once, andPress OR Hold Keyonly when you want a continuous stream of events while a button is held down. - Keep the axes threshold above the noise. At the default of 0.01 the trigger fires on very small stick movements. Raise the threshold if the event fires more often than intended.
- Record the values you need. Pair the trigger with a
Set / Record VariableAction and one of the trigger-specific values above to save the button or axis data.



