diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 18:48:53 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 18:54:52 +0200 |
commit | 21a363a2486a713434e890fc1f6b86a180755230 (patch) | |
tree | ca788ccf7c8269c5cbd41350463fa478aa499903 /mtdev/iobuf.c | |
parent | 523d193b089111849873d9de0ec1bf29f4176fbc (diff) | |
download | xorg-input-kobomultitouch-21a363a2486a713434e890fc1f6b86a180755230.tar.gz xorg-input-kobomultitouch-21a363a2486a713434e890fc1f6b86a180755230.tar.bz2 xorg-input-kobomultitouch-21a363a2486a713434e890fc1f6b86a180755230.zip |
Add tapping logic
This patch adds tap-to-click, tap-and-hold for dragging, two-finger
and three-finger taps. Turned on by default for touch screens only;
switch on in gestures.c.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'mtdev/iobuf.c')
-rw-r--r-- | mtdev/iobuf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mtdev/iobuf.c b/mtdev/iobuf.c index 8e367b8..65c33f6 100644 --- a/mtdev/iobuf.c +++ b/mtdev/iobuf.c @@ -20,6 +20,7 @@ **************************************************************************/ #include <mtdev-iobuf.h> +#include <sys/poll.h> void init_iobuf(struct IOBuffer *buf) { @@ -52,3 +53,11 @@ const struct input_event *get_iobuf_event(struct IOBuffer *buf, int fd) buf->at += EVENT_SIZE; return ev; } + +int poll_iobuf(struct IOBuffer *buf, int fd, int ms) +{ + struct pollfd fds = { fd, POLLIN, 0 }; + if (buf->top != buf->at) + return 1; + return poll(&fds, 1, ms); +} |