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>
This commit is contained in:
committed by
Kristian Høgsberg
parent
7bbd5b3335
commit
11d7139989
+2
-1
@@ -28,6 +28,7 @@
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
#include <GLES2/gl2.h> /* needed for GLfloat */
|
#include <GLES2/gl2.h> /* needed for GLfloat */
|
||||||
|
#include <linux/input.h>
|
||||||
|
|
||||||
struct display {
|
struct display {
|
||||||
struct wl_display *display;
|
struct wl_display *display;
|
||||||
@@ -96,7 +97,7 @@ pointer_handle_button(void *data, struct wl_pointer *pointer,
|
|||||||
struct input *input = data;
|
struct input *input = data;
|
||||||
uint32_t bit;
|
uint32_t bit;
|
||||||
|
|
||||||
bit = 1 << (button - 272);
|
bit = 1 << (button - BTN_LEFT);
|
||||||
if (state)
|
if (state)
|
||||||
input->button_mask |= bit;
|
input->button_mask |= bit;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user