mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-16 22:01:11 +00:00
Do not complain about incorrect mapping when some abs are not used
This commit is contained in:
+4
-4
@@ -99,7 +99,7 @@ int evdev_gamepads = 0;
|
|||||||
|
|
||||||
static bool (*handler) (struct input_event*, struct input_device*);
|
static bool (*handler) (struct input_event*, struct input_device*);
|
||||||
|
|
||||||
static int evdev_get_map_key(int* map, int length, int value) {
|
static int evdev_get_map(int* map, int length, int value) {
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
if (value == map[i])
|
if (value == map[i])
|
||||||
return i;
|
return i;
|
||||||
@@ -108,7 +108,7 @@ static int evdev_get_map_key(int* map, int length, int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool evdev_init_parms(struct input_device *dev, struct input_abs_parms *parms, int code) {
|
static bool evdev_init_parms(struct input_device *dev, struct input_abs_parms *parms, int code) {
|
||||||
int abs = evdev_get_map_key(dev->abs_map, ABS_MAX, code);
|
int abs = evdev_get_map(dev->abs_map, ABS_MAX, code);
|
||||||
|
|
||||||
if (abs >= 0) {
|
if (abs >= 0) {
|
||||||
parms->flat = libevdev_get_abs_flat(dev->dev, abs);
|
parms->flat = libevdev_get_abs_flat(dev->dev, abs);
|
||||||
@@ -518,8 +518,8 @@ void evdev_create(const char* device, struct mapping* mappings, bool verbose) {
|
|||||||
devices[dev].fd = fd;
|
devices[dev].fd = fd;
|
||||||
devices[dev].dev = evdev;
|
devices[dev].dev = evdev;
|
||||||
devices[dev].map = mappings;
|
devices[dev].map = mappings;
|
||||||
memset(&devices[dev].key_map, -1, sizeof(devices[dev].key_map));
|
memset(&devices[dev].key_map, -2, sizeof(devices[dev].key_map));
|
||||||
memset(&devices[dev].abs_map, -1, sizeof(devices[dev].abs_map));
|
memset(&devices[dev].abs_map, -2, sizeof(devices[dev].abs_map));
|
||||||
|
|
||||||
int nbuttons = 0;
|
int nbuttons = 0;
|
||||||
for (int i = BTN_JOYSTICK; i < KEY_MAX; ++i) {
|
for (int i = BTN_JOYSTICK; i < KEY_MAX; ++i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user