diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hwdata.c | 4 | ||||
-rw-r--r-- | src/hwdata.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/hwdata.c b/src/hwdata.c index d39211f..cd93fe0 100644 --- a/src/hwdata.c +++ b/src/hwdata.c @@ -39,16 +39,20 @@ bool read_hwdata(struct HWData *hw, const struct input_event* ev) CLEARBIT(hw->button, MT_BUTTON_RIGHT); break; case BTN_MT_REPORT_PACKET: + hw->in_packet = ev->value; if (ev->value) hw->nfinger = 0; break; case BTN_MT_REPORT_FINGER: + hw->in_finger = ev->value; if (!ev->value && hw->nfinger < DIM_FINGER) hw->nfinger++; break; } break; case EV_ABS: + if (!hw->in_packet || !hw->in_finger) + break; if (hw->nfinger == DIM_FINGER) break; switch (ev->code) { diff --git a/src/hwdata.h b/src/hwdata.h index f91f11b..a5f9bf5 100644 --- a/src/hwdata.h +++ b/src/hwdata.h @@ -26,6 +26,7 @@ struct HWData { struct FingerData finger[DIM_FINGER]; button_t button; int nfinger; + bool in_packet, in_finger; }; //////////////////////////////////////////////////////// |