Constants
GPC3 uses generic controller constants. These are the identifiers to use with get_val(), set_val(), event functions, and timing functions.
The names below describe Helios input before any custom Input Translator or remapping. Confirm your device in Device Monitor when using a different host or translator.
| Constant |
Index |
Common use |
BUTTON_1 |
0 |
Guide / PS / system |
BUTTON_2 |
1 |
View / Back (Xbox); touchpad click (PlayStation) |
BUTTON_3 |
2 |
Menu / Options |
BUTTON_4 |
3 |
Right bumper / R1 |
BUTTON_5 |
4 |
Right trigger / R2 |
BUTTON_6 |
5 |
Right stick click / R3 |
BUTTON_7 |
6 |
Left bumper / L1 |
BUTTON_8 |
7 |
Left trigger / L2 |
BUTTON_9 |
8 |
Left stick click / L3 |
BUTTON_10 |
9 |
D-pad up |
BUTTON_11 |
10 |
D-pad down |
BUTTON_12 |
11 |
D-pad left |
BUTTON_13 |
12 |
D-pad right |
BUTTON_14 |
13 |
Top face / Y / Triangle |
BUTTON_15 |
14 |
Right face / B / Circle |
BUTTON_16 |
15 |
Bottom face / A / Cross |
BUTTON_17 |
16 |
Left face / X / Square |
BUTTON_18 |
17 |
Share (when supported) |
BUTTON_19 |
18 |
First touch active (when supported) |
BUTTON_20 |
19 |
Second touch active (when supported) |
BUTTON_21 |
20 |
DualSense microphone button (when supported) |
Sticks
| Constant |
Index |
Description |
STICK_1_X |
21 |
Stick 1 horizontal (right stick in the standard layout) |
STICK_1_Y |
22 |
Stick 1 vertical (right stick in the standard layout) |
STICK_2_X |
23 |
Stick 2 horizontal (left stick in the standard layout) |
STICK_2_Y |
24 |
Stick 2 vertical (left stick in the standard layout) |
Touch Points
| Constant |
Index |
Description |
POINT_1_X |
25 |
Touch/point 1 horizontal |
POINT_1_Y |
26 |
Touch/point 1 vertical |
POINT_2_X |
27 |
Touch/point 2 horizontal |
POINT_2_Y |
28 |
Touch/point 2 vertical |
| Constant |
Index |
Description |
ACCEL_1_X |
29 |
Accelerometer 1 X |
ACCEL_1_Y |
30 |
Accelerometer 1 Y |
ACCEL_1_Z |
31 |
Accelerometer 1 Z |
ACCEL_2_X |
32 |
Accelerometer 2 X |
ACCEL_2_Y |
33 |
Accelerometer 2 Y |
ACCEL_2_Z |
34 |
Accelerometer 2 Z |
GYRO_1_X |
35 |
Gyro X |
GYRO_1_Y |
36 |
Gyro Y |
GYRO_1_Z |
37 |
Gyro Z |
PADDLE_1 |
38 |
Paddle 1 |
PADDLE_2 |
39 |
Paddle 2 |
PADDLE_3 |
40 |
Paddle 3 |
PADDLE_4 |
41 |
Paddle 4 |
Value Ranges
| Input type |
Typical range |
| Digital buttons |
0 or 100 |
| Analog triggers |
0 to 100 |
| Stick axes |
-100 to 100 |
| Motion axes |
Host-provided |
Boolean Values
| Constant |
Value |
TRUE |
1 |
FALSE |
0 |
Polar and Profile Constants
| Constants |
Use |
POLAR_LS, POLAR_RS |
Select the left or right stick |
POLAR_ANGLE, POLAR_RADIUS |
Select the polar component to read |
POLAR_GHOST, ANALOG_GHOSTX, ANALOG_GHOSTY |
Calculate and read a virtual stick vector |
PENDING_CONFIG, ACTIVE_CONFIG |
Read mouse-translation profile state with get_info() |
Example
gpcmain {
if (get_val(BUTTON_5) > 50) {
set_val(BUTTON_5, 100);
}
fix32 stick_x = get_val(STICK_1_X);
set_val(STICK_1_X, clamp(stick_x * 1.15, -100.0, 100.0));
}
Notes
- You can pass raw numeric IDs, but named constants make scripts easier to read.
- Button labels vary by controller. Use the common-use column as a starting point, then test with your device.
- The compiler-recognized constants are the generic names above.