[PATCH weston v1 16/17] test-helpers: add functions that simulate pointer actions

Pekka Paalanen ppaalanen at gmail.com
Mon Dec 15 01:10:34 PST 2014


On Fri,  5 Dec 2014 14:36:49 +0100
Marek Chalupa <mchqwerty at gmail.com> wrote:

> Add functions that simulate pointer movement, draging and clicking.
> These functions will be handy in more tests, so add them to helpers.
> 
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  tests/weston-test-client-helper.c | 57 +++++++++++++++++++++++++++++++++++++++
>  tests/weston-test-client-helper.h |  9 +++++++
>  2 files changed, 66 insertions(+)
> 
> diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
> index dc34fc4..7f7f4f5 100644
> --- a/tests/weston-test-client-helper.c
> +++ b/tests/weston-test-client-helper.c
> @@ -28,6 +28,7 @@
>  #include <unistd.h>
>  #include <errno.h>
>  #include <sys/mman.h>
> +#include <linux/input.h>

> +void
> +pointer_click(struct client *client, uint32_t button)
> +{
> +	struct wl_test *wl_test = client->test->wl_test;
> +
> +	wl_test_send_button(wl_test, button, WL_POINTER_BUTTON_STATE_PRESSED);
> +	wl_display_flush(client->wl_display);
> +
> +	usleep(MSEC_TO_USEC(30));

nanosleep, please. :-)


Thanks,
pq


More information about the wayland-devel mailing list