diff --git a/test/litest-device-huion-pentablet.c b/test/litest-device-huion-pentablet.c index 40093973..6be659b6 100644 --- a/test/litest-device-huion-pentablet.c +++ b/test/litest-device-huion-pentablet.c @@ -56,10 +56,24 @@ static struct input_event motion[] = { { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, { .type = -1, .code = -1 }, }; + +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_PRESSURE: + *value = 100; + return 0; + } + return 1; +} + static struct litest_device_interface interface = { .tablet_proximity_in_events = proximity_in, .tablet_proximity_out_events = proximity_out, .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, }; static struct input_absinfo absinfo[] = { diff --git a/test/litest-device-wacom-bamboo-tablet.c b/test/litest-device-wacom-bamboo-tablet.c index d21d4be0..2cf98c35 100644 --- a/test/litest-device-wacom-bamboo-tablet.c +++ b/test/litest-device-wacom-bamboo-tablet.c @@ -60,10 +60,23 @@ static struct input_event motion[] = { { .type = -1, .code = -1 }, }; +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_PRESSURE: + *value = 100; + return 0; + } + return 1; +} + static struct litest_device_interface interface = { .tablet_proximity_in_events = proximity_in, .tablet_proximity_out_events = proximity_out, .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, }; static struct input_absinfo absinfo[] = { diff --git a/test/litest-device-wacom-cintiq-tablet.c b/test/litest-device-wacom-cintiq-tablet.c index 0217f560..db3173cd 100644 --- a/test/litest-device-wacom-cintiq-tablet.c +++ b/test/litest-device-wacom-cintiq-tablet.c @@ -71,10 +71,30 @@ static struct input_event motion[] = { { .type = -1, .code = -1 }, }; +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_TILT_X: + case ABS_TILT_Y: + *value = 0; + return 0; + case ABS_PRESSURE: + *value = 100; + return 0; + case ABS_DISTANCE: + *value = 0; + return 0; + } + return 1; +} + static struct litest_device_interface interface = { .tablet_proximity_in_events = proximity_in, .tablet_proximity_out_events = proximity_out, .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, }; static struct input_absinfo absinfo[] = { diff --git a/test/litest-device-wacom-intuos-tablet.c b/test/litest-device-wacom-intuos-tablet.c index e0e1d44b..682a56c1 100644 --- a/test/litest-device-wacom-intuos-tablet.c +++ b/test/litest-device-wacom-intuos-tablet.c @@ -70,10 +70,31 @@ static struct input_event motion[] = { { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, { .type = -1, .code = -1 }, }; + +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_TILT_X: + case ABS_TILT_Y: + *value = 0; + return 0; + case ABS_PRESSURE: + *value = 100; + return 0; + case ABS_DISTANCE: + *value = 0; + return 0; + } + return 1; +} + static struct litest_device_interface interface = { .tablet_proximity_in_events = proximity_in, .tablet_proximity_out_events = proximity_out, .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, }; static struct input_absinfo absinfo[] = { diff --git a/test/litest-device-wacom-isdv4-tablet.c b/test/litest-device-wacom-isdv4-tablet.c index c9d40e77..bc607057 100644 --- a/test/litest-device-wacom-isdv4-tablet.c +++ b/test/litest-device-wacom-isdv4-tablet.c @@ -55,10 +55,23 @@ static struct input_event motion[] = { { .type = -1, .code = -1 }, }; +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_PRESSURE: + *value = 100; + return 0; + } + return 1; +} + static struct litest_device_interface interface = { .tablet_proximity_in_events = proximity_in, .tablet_proximity_out_events = proximity_out, .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, }; static struct input_absinfo absinfo[] = { diff --git a/test/litest-device-waltop-tablet.c b/test/litest-device-waltop-tablet.c index 93ec739d..206b831d 100644 --- a/test/litest-device-waltop-tablet.c +++ b/test/litest-device-waltop-tablet.c @@ -62,10 +62,28 @@ static struct input_event motion[] = { { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, { .type = -1, .code = -1 }, }; + +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_TILT_X: + case ABS_TILT_Y: + *value = 0; + return 0; + case ABS_PRESSURE: + *value = 100; + return 0; + } + return 1; +} + static struct litest_device_interface interface = { .tablet_proximity_in_events = proximity_in, .tablet_proximity_out_events = proximity_out, .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, }; static struct input_absinfo absinfo[] = { diff --git a/test/litest.c b/test/litest.c index 632b144a..5c829277 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1519,7 +1519,9 @@ auto_assign_tablet_value(struct litest_device *d, value = litest_scale(d, ABS_Y, y); break; default: - axis_replacement_value(d, axes, ev->code, &value); + if (!axis_replacement_value(d, axes, ev->code, &value) && + d->interface->get_axis_default) + d->interface->get_axis_default(d, ev->code, &value); break; }