Skip to content

Gamepads and joysticks

Sygmei edited this page Sep 15, 2021 · 2 revisions

Gamepads are considered as "standard" input in ÖbEngine, they can be handled the same way than the keyboard keys.

Triggers and joysticks can also be used as buttons (even if in fact they return a float value instead of a boolean one), they use a threshold of 80% of activation course by default.

Here are the equivalent keys for a Xbox 360 Controller (considering that the gamepad uses the index 0 on the computer)

Xbox Controller Button name ÖbEngine equivalent code
A GP_0_BTN_0
B GP_0_BTN_1
X GP_0_BTN_2
Y GP_0_BTN_3
LB GP_0_BTN_4
RB GP_0_BTN_5
BACK GP_0_BTN_6
START GP_0_BTN_7
LTHUMB GP_0_BTN_8
RTHUMB GP_0_BTN_9
LT GP_0_AXIS_Z_LEFT
RT GP_0_AXIS_Z_RIGHT
LEFT_JOYSTICK_UP GP_0_AXIS_Y_UP
LEFT_JOYSTICK_DOWN GP_0_AXIS_Y_DOWN
LEFT_JOYSTICK_LEFT GP_0_AXIS_X_LEFT
LEFT_JOYSTICK_RIGHT GP_0_AXIS_X_RIGHT
RIGHT_JOYSTICK_UP GP_0_AXIS_R_UP
RIGHT_JOYSTICK_DOWN GP_0_AXIS_R_DOWN
RIGHT_JOYSTICK_LEFT GP_0_AXIS_U_LEFT
RIGHT_JOYSTICK_RIGHT GP_0_AXIS_U_RIGHT
DPAD_UP GP_0_AXIS_PovY_DOWN
DPAD_DOWN GP_0_AXIS_PovY_UP
DPAD_LEFT GP_0_AXIS_PovX_LEFT
DPAD_RIGHT GP_0_AXIS_PovX_RIGHT

You can also retrieve the axis values (for triggers and joysticks in this case) using the dedicated functions.

Clone this wiki locally