mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-22 16:16:39 +00:00
Check for non-available axis
This commit is contained in:
@@ -117,6 +117,11 @@ static void evdev_remove(int devindex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static short evdev_convert_value(struct input_event *ev, struct input_device *dev, struct input_abs_parms *parms, bool reverse) {
|
static short evdev_convert_value(struct input_event *ev, struct input_device *dev, struct input_abs_parms *parms, bool reverse) {
|
||||||
|
if (parms->max == 0 && parms->min == 0) {
|
||||||
|
fprintf(stderr, "Unmapped axis: %d\n", ev->code);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (abs(ev->value - parms->avg) < parms->flat)
|
if (abs(ev->value - parms->avg) < parms->flat)
|
||||||
return 0;
|
return 0;
|
||||||
else if (ev->value > parms->max)
|
else if (ev->value > parms->max)
|
||||||
@@ -130,6 +135,11 @@ static short evdev_convert_value(struct input_event *ev, struct input_device *de
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char evdev_convert_value_byte(struct input_event *ev, struct input_device *dev, struct input_abs_parms *parms) {
|
static char evdev_convert_value_byte(struct input_event *ev, struct input_device *dev, struct input_abs_parms *parms) {
|
||||||
|
if (parms->max == 0 && parms->min == 0) {
|
||||||
|
fprintf(stderr, "Unmapped axis: %d\n", ev->code);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (abs(ev->value-parms->min)<parms->flat)
|
if (abs(ev->value-parms->min)<parms->flat)
|
||||||
return 0;
|
return 0;
|
||||||
else if (ev->value>parms->max)
|
else if (ev->value>parms->max)
|
||||||
|
|||||||
Reference in New Issue
Block a user