firmware_TouchpadMTB: add a new validator to check physical clicks

Each gesture has its own event cycle. For example,

  For a one-finger physical click, its event cycle looks like:
    (1) finger clicking and pressing:
        BTN_TOUCH: 0 -> 1
        BTN_TOOL_FINGER: 0-> 1
        BTN_LEFT : 0-> 1
    (2) finger leaving:
        BTN_TOUCH: 1 -> 0
        BTN_TOOL_FINGER: 1-> 0
        BTN_LEFT : 1-> 0

  This CL defines what event cycles to check for one-finger to
five-finger touching, as well as physical clicks. A new validator
called PhysicalClickValidator is added to check if correct MTB
packets are presented.

BUG=chromium-os:34269
TEST=Run "DISPLAY=:0 sudo python main.py" in crosh of a chromebook.
Watch the test result of 'one_finger_tap', 'two_finger_tap',
'one_finger_physical_click', and 'two_finger_physical_click'.
The test result of PhysicalClickValidator is shown on the right
hand side of the window.

Change-Id: I19ea2463e82ca79f6b522efa010a579abbef7077
Reviewed-on: https://gerrit.chromium.org/gerrit/33193
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
3 files changed