summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-05-30 16:31:50 +0100
committerKristian Høgsberg <krh@bitplanet.net>2012-05-31 15:42:25 -0400
commit11d7139989860a1405124b889db2fbad087a5a09 (patch)
tree90690a80dacf8f7341f25d526a82028aa409c9e7
parent7bbd5b333567430ff06e9ceed20576291406011f (diff)
test-client.c: Replace hard-coded magic value
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 <daniel@fooishbar.org>
-rw-r--r--tests/test-client.c3
1 files changed, 2 insertions, 1 deletions
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