Input: 90% of max analog value while analog sticks setup.

This commit is contained in:
sorgelig
2019-03-24 11:27:03 +08:00
parent 0d35f66a81
commit d02deb0e39
2 changed files with 21 additions and 19 deletions

View File

@@ -1686,9 +1686,11 @@ static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int
if (ev->type == EV_ABS)
{
max = (ev->value == absinfo->maximum);
min = (ev->value == absinfo->minimum);
printf("min=%d,max=%d\n", min, max);
int threshold = (absinfo->maximum - absinfo->minimum) / 10;
max = (ev->value >= (absinfo->maximum - threshold));
min = (ev->value <= (absinfo->minimum + threshold));
printf("threshold=%d, min=%d, max=%d\n", threshold, min, max);
}
//check DPAD horz