|
@@ -349,7 +349,9 @@ guess_device_class(struct udev_device *dev)
|
|
} else if (test_bit(BTN_MOUSE, bitmask_key)) {
|
|
} else if (test_bit(BTN_MOUSE, bitmask_key)) {
|
|
devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
|
|
devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
|
|
} else if (test_bit(BTN_TOUCH, bitmask_key)) {
|
|
} else if (test_bit(BTN_TOUCH, bitmask_key)) {
|
|
- ; /* ID_INPUT_TOUCHSCREEN */
|
|
|
|
|
|
+ /* TODO: better determining between touchscreen and multitouch touchpad,
|
|
|
|
+ see https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-input_id.c */
|
|
|
|
+ devclass |= SDL_UDEV_DEVICE_TOUCHSCREEN; /* ID_INPUT_TOUCHSCREEN */
|
|
}
|
|
}
|
|
|
|
|
|
if (test_bit(BTN_TRIGGER, bitmask_key) ||
|
|
if (test_bit(BTN_TRIGGER, bitmask_key) ||
|
|
@@ -411,6 +413,11 @@ device_event(SDL_UDEV_deviceevent type, struct udev_device *dev)
|
|
if (val != NULL && SDL_strcmp(val, "1") == 0 ) {
|
|
if (val != NULL && SDL_strcmp(val, "1") == 0 ) {
|
|
devclass |= SDL_UDEV_DEVICE_MOUSE;
|
|
devclass |= SDL_UDEV_DEVICE_MOUSE;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ val = _this->udev_device_get_property_value(dev, "ID_INPUT_TOUCHSCREEN");
|
|
|
|
+ if (val != NULL && SDL_strcmp(val, "1") == 0 ) {
|
|
|
|
+ devclass |= SDL_UDEV_DEVICE_TOUCHSCREEN;
|
|
|
|
+ }
|
|
|
|
|
|
/* The undocumented rule is:
|
|
/* The undocumented rule is:
|
|
- All devices with keys get ID_INPUT_KEY
|
|
- All devices with keys get ID_INPUT_KEY
|