diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/hwdata.c | 8 | ||||
| -rw-r--r-- | src/hwdata.h | 2 |
2 files changed, 8 insertions, 2 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 | ||
| 37 | static void accept_finger(struct HWData *hw) | 38 | static void accept_finger(struct HWData *hw) |
| @@ -49,7 +50,9 @@ static void accept_finger(struct HWData *hw) | |||
| 49 | static void accept_packet(struct HWData *hw, const struct timeval* tv) | 50 | static 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); |
diff --git a/src/hwdata.h b/src/hwdata.h index 81d847b..15a9fcb 100644 --- a/src/hwdata.h +++ b/src/hwdata.h | |||
| @@ -73,7 +73,7 @@ struct HWData { | |||
| 73 | struct FingerData finger[DIM_FINGER]; | 73 | struct FingerData finger[DIM_FINGER]; |
| 74 | unsigned mask[DIM_FINGER], mread[DIM_FINGER]; | 74 | unsigned mask[DIM_FINGER], mread[DIM_FINGER]; |
| 75 | unsigned button; | 75 | unsigned button; |
| 76 | int nfinger, nread; | 76 | int nfinger, mtread, nread; |
| 77 | mstime_t evtime; | 77 | mstime_t evtime; |
| 78 | }; | 78 | }; |
| 79 | 79 | ||
