We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8436ce9 commit 3e47181Copy full SHA for 3e47181
src/core/linux/SDL_udev.c
@@ -424,9 +424,12 @@ static int device_class(struct udev_device *dev)
424
}
425
426
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER");
427
- if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE) &&
428
- val && SDL_strcmp(val, "1") == 0) {
429
- devclass |= SDL_UDEV_DEVICE_JOYSTICK;
+ if (val && SDL_strcmp(val, "1") == 0) {
+ if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_FALSE)) {
+ devclass |= SDL_UDEV_DEVICE_JOYSTICK;
430
+ } else {
431
+ devclass |= SDL_UDEV_DEVICE_ACCELEROMETER;
432
+ }
433
434
435
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_MOUSE");
0 commit comments