Hello everyone,
First, thank you, SDL developers and contributors, for making such a good library.
I’m trying to get the PS4 controller (Dualshock Wireless Controller) touchpad information, specifically finger position (X and Y). I don’t know what I’m doing wrong, but the touch Y value (SDL_Event.tfinger.y) is always 0 or 1 (X works fine).
I’m opening the controller with SDL_OpenGamepad(joy_index)
, activating the motion sensors using SDL_SetGamepadSensorEnabled(SDL_Gamepad_instance, SDL_SENSOR_GYRO, SDL_TRUE)
and SDL_SetGamepadSensorEnabled(SDL_Gamepad_instance, SDL_SENSOR_ACCEL, SDL_TRUE)
. I also enable rumble with SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
.
All other events work as expected. I’m using SDL3 compiled as a static library, but the same behaviour appears with SDL2 and using the system-wide installed package libsdl2-dev (Ubuntu 22.04).
I poll SDL events every 2 ms using SDL_PollEvent, and filter the events manually. The source is available at GitHub - Puara/puara-controller at json.
Thanks in advance