Skip to main content

MaaGamepadTouch

Type Alias MaaGamepadTouch 

Source
pub type MaaGamepadTouch = u64;
Expand description

@brief Virtual gamepad touch contact definitions for touch_down/touch_move/touch_up

For gamepad controller, the touch functions are repurposed for analog inputs:

  • x, y: Analog stick position
  • pressure: Trigger value (0~255)

Contact mapping:

ContactInputx rangey rangepressureDescription
0Left Stick-32768~32767-32768~32767ignoredLeft analog stick X/Y position
1Right Stick-32768~32767-32768~32767ignoredRight analog stick X/Y position
2Left Triggerignoredignored0~255Left trigger (LT/L2) value
3Right Triggerignoredignored0~255Right trigger (RT/R2) value

Usage:

  • touch_down(contact, x, y, pressure): Start analog input
  • touch_move(contact, x, y, pressure): Update analog input position/value
  • touch_up(contact): Release/reset analog input to center/zero