For the complete documentation index, see llms.txt. This page is also available as Markdown.

Touch and Wii IR

Read DS4 touch data:

  • PS4T_P1 and PS4T_P2 return a touch-active boolean.

  • The X/Y selectors return normalized positions from -100..100.

  • 0, 0 is the center; negative/positive X move left/right and negative/positive Y move up/down.

read-ds4-touch.gpc
int touch_x;
int touch_y;

main {
    if(ps4_touchpad(PS4T_P1)) {
        touch_x = ps4_touchpad(PS4T_P1X);
        touch_y = ps4_touchpad(PS4T_P1Y);
    }
}

Write a normalized touch point:

main {
    if(get_ival(PS4_L2)) {
        ps4_set_touchpad(0, 0);
    }
}

ps4_set_touchpad(x, y) uses the same -100..100 normalized coordinate range. It creates one reported touch point at that position while the call is active.

Wii IR check:

Last updated