From 7380af2c93dc83f4f09e293717d46eadf7799e89 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 21 Jun 2010 18:56:49 +0200 Subject: Simplify event reading This patch puts the reading code more in line with the upcoming mtdev library, and should remove some spurious input behavior. Signed-off-by: Henrik Rydberg --- src/hwstate.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/hwstate.c') diff --git a/src/hwstate.c b/src/hwstate.c index b29ee54..82a3a10 100644 --- a/src/hwstate.c +++ b/src/hwstate.c @@ -43,8 +43,8 @@ static void finish_packet(struct HWState *s, const struct Capabilities *caps, s->evtime = syn->time.tv_usec / ms + syn->time.tv_sec * ms; } -static int read_event(struct HWState *s, const struct Capabilities *caps, - const struct input_event *ev) +int hwstate_read(struct HWState *s, const struct Capabilities *caps, + const struct input_event *ev) { switch (ev->type) { case EV_SYN: @@ -107,15 +107,3 @@ static int read_event(struct HWState *s, const struct Capabilities *caps, } return 0; } - -int modify_hwstate(struct HWState *s, struct MTDev *dev, - const struct Capabilities *caps) -{ - struct input_event ev; - while (!mtdev_empty(dev)) { - mtdev_get(dev, &ev); - if (read_event(s, caps, &ev)) - return 1; - } - return 0; -} -- cgit v1.2.3