Took me a second to work out that the 272 was actually BTN_LEFT, as keys
and buttons share a namespace in evdev.

Signed-off-by: Daniel Stone <[email protected]>
---
 tests/test-client.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test-client.c b/tests/test-client.c
index c6dfd96..fc65ee6 100644
--- a/tests/test-client.c
+++ b/tests/test-client.c
@@ -28,6 +28,7 @@
 #include <poll.h>
 #include <wayland-client.h>
 #include <GLES2/gl2.h> /* needed for GLfloat */
+#include <linux/input.h>
 
 struct display {
        struct wl_display *display;
@@ -96,7 +97,7 @@ pointer_handle_button(void *data, struct wl_pointer *pointer,
        struct input *input = data;
        uint32_t bit;
 
-       bit = 1 << (button - 272);
+       bit = 1 << (button - BTN_LEFT);
        if (state)
                input->button_mask |= bit;
        else
-- 
1.7.10

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to