mirror of https://github.com/libsdl-org/SDL.git
Default SDL_HINT_ACCELEROMETER_AS_JOYSTICK to 0 on Linux
The Linux joystick driver supports associating sensor devices with the related controller device, so enable that by default. Fixes https://github.com/libsdl-org/SDL/issues/12043
This commit is contained in:
parent
8436ce98b4
commit
3e47181800
|
|
@ -424,9 +424,12 @@ static int device_class(struct udev_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER");
|
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER");
|
||||||
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE) &&
|
if (val && SDL_strcmp(val, "1") == 0) {
|
||||||
val && SDL_strcmp(val, "1") == 0) {
|
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_FALSE)) {
|
||||||
devclass |= SDL_UDEV_DEVICE_JOYSTICK;
|
devclass |= SDL_UDEV_DEVICE_JOYSTICK;
|
||||||
|
} else {
|
||||||
|
devclass |= SDL_UDEV_DEVICE_ACCELEROMETER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_MOUSE");
|
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_MOUSE");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue