Revert "Fix pressing unmapped buttons causing unexpected inputs"

Instead, we should not exclude certain buttons from mappings.

This reverts commit 21b6af349358a0da2552a45e5448dc551f490253.
This commit is contained in:
Cameron Gutman 2021-08-08 11:16:57 -05:00
parent 21b6af3493
commit d45567b5ee

View File

@ -376,7 +376,7 @@ static bool evdev_handle_event(struct input_event *ev, struct input_device *dev)
break;
default:
gamepadModified = true;
if (dev->map == NULL || index == -1)
if (dev->map == NULL)
break;
else if (index == dev->map->btn_a)
gamepadCode = A_FLAG;
@ -458,9 +458,9 @@ static bool evdev_handle_event(struct input_event *ev, struct input_device *dev)
break;
}
}
} else if (dev->map != NULL && index != -1 && index == dev->map->btn_lefttrigger)
} else if (dev->map != NULL && index == dev->map->btn_lefttrigger)
dev->leftTrigger = ev->value ? UCHAR_MAX : 0;
else if (dev->map != NULL && index != -1 && index == dev->map->btn_righttrigger)
else if (dev->map != NULL && index == dev->map->btn_righttrigger)
dev->rightTrigger = ev->value ? UCHAR_MAX : 0;
else {
if (dev->map != NULL)