Avoid mapping PS4 trackpad as a gamepad

This commit is contained in:
Cameron Gutman 2021-07-25 19:10:01 -05:00
parent 836e61b7c3
commit 663e4b4b7a

View File

@ -655,20 +655,25 @@ void evdev_create(const char* device, struct mapping* mappings, bool verbose, in
libevdev_has_event_code(evdev, EV_ABS, ABS_GAS) ||
libevdev_has_event_code(evdev, EV_ABS, ABS_BRAKE));
if (mappings == NULL && is_gamepad) {
fprintf(stderr, "No mapping available for %s (%s) on %s\n", name, str_guid, device);
mappings = default_mapping;
}
if (is_gamepad)
evdev_gamepads++;
if (is_accelerometer) {
libevdev_free(evdev);
close(fd);
return;
}
if (is_gamepad) {
evdev_gamepads++;
if (mappings == NULL) {
fprintf(stderr, "No mapping available for %s (%s) on %s\n", name, str_guid, device);
mappings = default_mapping;
}
} else {
if (verbose)
printf("Not mapping %s as a gamepad\n", name);
mappings = NULL;
}
int dev = numDevices;
numDevices++;