mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 04:40:25 +01:00
test: add two more touch..._extended functions
So we can set pressure during touch sequences Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6ef816b4f5
commit
7c8cecdb02
2 changed files with 30 additions and 0 deletions
|
|
@ -1643,6 +1643,28 @@ litest_touch_move_to(struct litest_device *d,
|
|||
litest_touch_move(d, slot, x_to, y_to);
|
||||
}
|
||||
|
||||
void
|
||||
litest_touch_move_to_extended(struct litest_device *d,
|
||||
unsigned int slot,
|
||||
double x_from, double y_from,
|
||||
double x_to, double y_to,
|
||||
struct axis_replacement *axes,
|
||||
int steps, int sleep_ms)
|
||||
{
|
||||
for (int i = 1; i < steps - 1; i++) {
|
||||
litest_touch_move_extended(d, slot,
|
||||
x_from + (x_to - x_from)/steps * i,
|
||||
y_from + (y_to - y_from)/steps * i,
|
||||
axes);
|
||||
if (sleep_ms) {
|
||||
libinput_dispatch(d->libinput);
|
||||
msleep(sleep_ms);
|
||||
libinput_dispatch(d->libinput);
|
||||
}
|
||||
}
|
||||
litest_touch_move_extended(d, slot, x_to, y_to, axes);
|
||||
}
|
||||
|
||||
static int
|
||||
auto_assign_tablet_value(struct litest_device *d,
|
||||
const struct input_event *ev,
|
||||
|
|
|
|||
|
|
@ -437,6 +437,14 @@ litest_touch_move_to(struct litest_device *d,
|
|||
double x_to, double y_to,
|
||||
int steps, int sleep_ms);
|
||||
|
||||
void
|
||||
litest_touch_move_to_extended(struct litest_device *d,
|
||||
unsigned int slot,
|
||||
double x_from, double y_from,
|
||||
double x_to, double y_to,
|
||||
struct axis_replacement *axes,
|
||||
int steps, int sleep_ms);
|
||||
|
||||
void
|
||||
litest_touch_move_two_touches(struct litest_device *d,
|
||||
double x0, double y0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue