test: auto-update for BTN_TOOL_* when using litest_touch_ functions
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 21 Jul 2014 02:30:40 +0000 (12:30 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 23 Jul 2014 05:08:15 +0000 (15:08 +1000)
commit61995348d911d763960454725a91043989844e8f
tree5ad8160cf569a161f408ccf06a41de3b73635c6f
parentbb10ec84d3704fc0fb40591bcbffe90f6c77966d
test: auto-update for BTN_TOOL_* when using litest_touch_ functions

Set BTN_TOUCH, BTN_TOOL_DOUBLETAP automatically depending on the number of
fingers down.

This emulates real event sequences a bit better than the current approach,
though it's not a 100% correct emulation:
1) On real devices, BTN_* are usually sent last before the SYN_REPORT - here
   they are sent first to slot in with the custom, device-specific event
   sequence. We should only ever look at the complete sequence anyway, so this
   shouldn't matter.
2) On real devices, the switch from BTN_TOOL_DOUBLETAP to TRIPLETAP and vice
   versa is not always toggled within the same SYN_REPORT
3) On synaptics devices, BTN_TOUCH is released in the frame where
   BTN_TOOL_DOUBLETAP is set. It is then immediately set again in the next
   frame.  With the current litest framework this is hard to integrate, so we
   just leave BTN_TOUCH set the whole time, which is what MT devices do if
   they don't have BTN_TOOL_DOUBLETAP.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
test/litest-bcm5974.c
test/litest-synaptics-st.c
test/litest-synaptics-t440.c
test/litest-synaptics.c
test/litest.c
test/litest.h