Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controllers/joysticks which cause constant input should be ignored #1276

Open
rversteegen opened this issue Dec 2, 2024 · 0 comments
Open
Labels
controls Keyboard, mouse and joystick/gamepad input/controls gfx_sdl2 Specific to the SDL 2 graphics/IO backend needs improvement It ain't completely broken... but it ain't quite the way it should be yet

Comments

@rversteegen
Copy link
Contributor

Someone reported that their (apparently) Huion H950p tablet is detected by SDL as a game controller, and unfortunately it seems to report a stylus position of 0,0 by default which SDL interprets as up-left (minimum possible value in the first two axes). They mentioned that other games like Super Tux Kart don't have this problem.

SDL doesn't have this device in its controller DB, it's just reporting a detected device so I think it's up to us to filter out devices like this. Something I've wanted to do is ignore input from controllers/joysticks which has been constant since the device was detected. This is actually a fairly common problem, also occurring when a gamepad has a stuck key (or is lying facedown somewhere). Also, the fact that we accept input from any controller/joystick on the system makes us quite susceptible to this.

The debug log shows the tablet is detected as 2 USB devices, a "Pad" and a "Touch Strip", so SDL really does think it's a gamepad?

Note that the "dylib_noload(libSDL2.so) failed" message means we couldn't call and report the output of SDL_GameControllerTypeForIndex.

 0.0  Initialising gfx_sdl2...
 0.0  ! dylib_noload(libSDL2.so) failed. Continuing
 0.7  setvideomode zoom=2 w*h = 640,400
 1.0  gfx_sdl2 SDL 2.30.0 (3 joysticks) Driver: x11 Render driver: opengl // gfx_sdl2 Drivers: x11 wayland KMSDRM offscreen dummy evdev  Render Drivers: opengl (hwaccel,vsync,textarget) opengles2 (hwaccel,vsync,textarget) software (vsync,textarget)
 ...
 1.0  Joystick 0 GUID 030072e66c2500006d000000110100 instance_id 0
 1.0   Opened as gamecontroller HID 256c:006d Pad
 1.0  030072e66c2500006d00000011010000,HID 256c:006d Pad,a:b0,b:b1,leftx:a0,lefty:a1,crc:e672,platform:Linux
 1.0  Opened joystick 0 HID 256c:006d Pad (id 0) -- 14 buttons 2 axes 0 hats 0 balls
 1.0  Joystick 1 GUID 03000d6e6c2500006d000000110100 instance_id 1
 1.0   Opened as gamecontroller HID 256c:006d Pad
 1.0  03000d6e6c2500006d00000011010000,HID 256c:006d Pad,a:b0,b:b1,leftx:a0,lefty:a1,crc:e672,platform:Linux
 1.0  Opened joystick 1 HID 256c:006d Touch Strip (id 1) -- 1 buttons 4 axes 0 hats 0 balls
@rversteegen rversteegen added needs improvement It ain't completely broken... but it ain't quite the way it should be yet controls Keyboard, mouse and joystick/gamepad input/controls gfx_sdl2 Specific to the SDL 2 graphics/IO backend labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controls Keyboard, mouse and joystick/gamepad input/controls gfx_sdl2 Specific to the SDL 2 graphics/IO backend needs improvement It ain't completely broken... but it ain't quite the way it should be yet
Projects
None yet
Development

No branches or pull requests

1 participant