summaryrefslogtreecommitdiff
path: root/src/hwdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hwdata.c')
-rw-r--r--src/hwdata.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/hwdata.c b/src/hwdata.c
index 9ec6241..689418e 100644
--- a/src/hwdata.c
+++ b/src/hwdata.c
@@ -32,6 +32,7 @@ static void set_value(struct HWData *hw, int code, int value)
32 (&hw->finger[hw->nread].touch_major)[code] = value; 32 (&hw->finger[hw->nread].touch_major)[code] = value;
33 SETBIT(hw->mread[hw->nread], code); 33 SETBIT(hw->mread[hw->nread], code);
34 } 34 }
35 hw->mtread++;
35} 36}
36 37
37static void accept_finger(struct HWData *hw) 38static void accept_finger(struct HWData *hw)
@@ -49,7 +50,9 @@ static void accept_finger(struct HWData *hw)
49static void accept_packet(struct HWData *hw, const struct timeval* tv) 50static void accept_packet(struct HWData *hw, const struct timeval* tv)
50{ 51{
51 static const mstime_t ms = 1000; 52 static const mstime_t ms = 1000;
52 hw->nfinger = hw->nread; 53 if (hw->mtread)
54 hw->nfinger = hw->nread;
55 hw->mtread = 0;
53 hw->nread = 0; 56 hw->nread = 0;
54 hw->mread[hw->nread] = 0; 57 hw->mread[hw->nread] = 0;
55 hw->evtime = tv->tv_usec / ms + tv->tv_sec * ms; 58 hw->evtime = tv->tv_usec / ms + tv->tv_sec * ms;
@@ -70,6 +73,9 @@ int read_hwdata(struct HWData *hw, const struct input_event* ev)
70 break; 73 break;
71 case EV_KEY: 74 case EV_KEY:
72 switch (ev->code) { 75 switch (ev->code) {
76 case BTN_TOUCH:
77 hw->mtread++;
78 break;
73 case BTN_LEFT: 79 case BTN_LEFT:
74 if (ev->value) 80 if (ev->value)
75 SETBIT(hw->button, MT_BUTTON_LEFT); 81 SETBIT(hw->button, MT_BUTTON_LEFT);