summaryrefslogtreecommitdiff
path: root/src/mtouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mtouch.c')
-rw-r--r--src/mtouch.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mtouch.c b/src/mtouch.c
index a74a1f6..e469d2e 100644
--- a/src/mtouch.c
+++ b/src/mtouch.c
@@ -1,5 +1,4 @@
1#include "mtouch.h" 1#include "mtouch.h"
2#include <errno.h>
3 2
4/******************************************************/ 3/******************************************************/
5 4
@@ -17,6 +16,8 @@ int configure_mtouch(struct MTouch *mt, int fd)
17int open_mtouch(struct MTouch *mt, int fd) 16int open_mtouch(struct MTouch *mt, int fd)
18{ 17{
19 int rc; 18 int rc;
19 init_iobuf(&mt->buf);
20 init_hwdata(&mt->hw);
20 if (mt->grabbed) 21 if (mt->grabbed)
21 return 0; 22 return 0;
22 SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)1)); 23 SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)1));
@@ -34,7 +35,7 @@ void close_mtouch(struct MTouch *mt, int fd)
34{ 35{
35 int rc; 36 int rc;
36 if (!mt->grabbed) 37 if (!mt->grabbed)
37 return 0; 38 return;
38 SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)0)); 39 SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)0));
39 if (rc < 0) 40 if (rc < 0)
40 xf86Msg(X_WARNING, "multitouch: cannot ungrab device\n"); 41 xf86Msg(X_WARNING, "multitouch: cannot ungrab device\n");
@@ -42,3 +43,14 @@ void close_mtouch(struct MTouch *mt, int fd)
42} 43}
43 44
44/******************************************************/ 45/******************************************************/
46
47bool read_synchronized_event(struct MTouch *mt, int fd)
48{
49 const struct input_event* ev;
50 while(ev = get_iobuf_event(&mt->buf, fd))
51 if (read_hwdata(&mt->hw, ev))
52 return 1;
53 return 0;
54}
55
56/******************************************************/