Set udev class for accelerometer

This commit is contained in:
meyraud705
2024-03-03 09:25:52 +01:00
committed by Sam Lantinga
parent e524e545f2
commit c6ec999869
2 changed files with 6 additions and 1 deletions

View File

@@ -360,7 +360,7 @@ static void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_clas
switch (udev_type) {
case SDL_UDEV_DEVICEADDED:
if (!(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) {
if (!(udev_class & (SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_ACCELEROMETER))) {
return;
}
if (SDL_classic_joysticks) {