input: analog sticks on wiimote has Y inverted.

This commit is contained in:
sorgelig
2019-05-09 23:50:08 +08:00
parent 87978756c2
commit 5e63d8b3da

View File

@@ -1750,7 +1750,7 @@ static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int
if (ev->type == EV_ABS)
{
int threshold = (absinfo->maximum - absinfo->minimum) / 10;
int threshold = (absinfo->maximum - absinfo->minimum) / 5;
max = (ev->value >= (absinfo->maximum - threshold));
min = (ev->value <= (absinfo->minimum + threshold));
@@ -2485,6 +2485,11 @@ int input_test(int getchar)
//LT/RT analog
continue;
}
else if(ev.code & 1)
{
//Y axes on wiimote and accessories are inverted
ev.value = -ev.value;
}
}
}