@@ -35,6 +35,9 @@ struct ntrig_data {
__u8 mt_footer[4];
__u8 mt_foot_count;
+
+ __u8 deactivate_slack;
+ __u8 deactivate_state;
};
/*
@@ -192,6 +195,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
/* Pen activity signal, trigger end of touch. */
if (nd->mt_footer[2]) {
nd->confidence = 0;
+ nd->deactivate_state = 0;
break;
}
@@ -252,14 +256,16 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
BTN_TOOL_QUADTAP, 1);
}
input_report_key(input, BTN_TOUCH, 1);
- } else {
+ nd->deactivate_state = nd->deactivate_slack;
+ } else if (! nd->deactivate_state) {
input_report_key(input,
BTN_TOOL_DOUBLETAP, 0);
input_report_key(input,
BTN_TOOL_TRIPLETAP, 0);
input_report_key(input,
BTN_TOOL_QUADTAP, 0);
- }
+ } else
+ nd->deactivate_state--;
break;
default:
@@ -292,6 +298,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
}
nd->reading_mt = 0;
+ nd->deactivate_slack = 4;
+ nd->deactivate_state = 0;
hid_set_drvdata(hdev, nd);
ret = hid_parse(hdev);