[PATCH libinput] touchpad: don't tap for 2fg down, followed by a single finger up

Hans de Goede hdegoede at redhat.com
Fri Sep 4 01:26:46 PDT 2015


Hi,

On 04-09-15 09:09, Peter Hutterer wrote:
> The following sequence currently generates a right-button event:
> 	finger 1 down
> 	finger 2 down
> 	finger 1 up
> 	finger 2 held down
>
> This is easily triggered with short scroll events. There are two issues here:
> first is that the tapping code elsewhere treats any tap with a second finger
> down as a left-button tap, not a right button one. So if anything, we should
> generate a left button click here, not a right button click.
>
> Arguably, generating a button click here is wrong though, it's not a very well
> defined sequence and relatively difficult to trigger intentionally. So the
> best solution here is to simply ignore the release event and move straight
> back to state HOLD - unless the second finger is released within the timeout.
> If the finger is set down again during the timeout, we move straight to
> TOUCH_2_HOLD - this could eventually be interpreted as a tap, but not for now.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

A what fun. I've reviewed both the state-machine and the code changes
and both look good to me:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans


> ---
>   doc/touchpad-tap-state-machine.svg | 255 +++++++++++++++++++++++--------------
>   src/evdev-mt-touchpad-tap.c        |  41 +++++-
>   src/evdev-mt-touchpad.h            |   1 +
>   test/touchpad-tap.c                |  46 +++++++
>   4 files changed, 241 insertions(+), 102 deletions(-)
>
> diff --git a/doc/touchpad-tap-state-machine.svg b/doc/touchpad-tap-state-machine.svg
> index b1c5995..4a9a129 100644
> --- a/doc/touchpad-tap-state-machine.svg
> +++ b/doc/touchpad-tap-state-machine.svg
> @@ -35,11 +35,11 @@
>       </g>
>       <path d="M 1691.5 332 L 1518.33 408.12" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1513.52 410.23 L 1518.52 404.21 L 1518.33 408.12 L 1521.34 410.62 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1434.22 722.1 C 1435.36 718.9 1437.22 717.04 1439.18 717.12 L 1507.64 717.12 C 1509.2 717.08 1510.7 717.63 1511.67 718.61 C 1512.65 719.59 1512.99 720.88 1512.6 722.1 L 1493.75 771.9 C 1492.61 775.1 1490.75 776.96 1488.79 776.88 L 1419.34 776.88 C 1417.95 776.69 1416.73 776.05 1415.97 775.1 C 1415.22 774.15 1415 772.99 1415.37 771.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1196.22 715.1 C 1197.36 711.9 1199.22 710.04 1201.18 710.12 L 1269.64 710.12 C 1271.2 710.08 1272.7 710.63 1273.67 711.61 C 1274.65 712.59 1274.99 713.88 1274.6 715.1 L 1255.75 764.9 C 1254.61 768.1 1252.75 769.96 1250.79 769.88 L 1181.34 769.88 C 1179.95 769.69 1178.73 769.05 1177.97 768.1 C 1177.22 767.15 1177 765.99 1177.37 764.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1463.75" y="743.75">
> +      <text x="1225.75" y="736.75">
>   	button 1</text>
> -      <text x="1463.75" y="757.75">
> +      <text x="1225.75" y="750.75">
>   	press</text>
>       </g>
>       <path d="M 1983.54 407 C 1986.34 403.86 1990.32 402.05 1994.52 402 L 2028.49 402 C 2032.69 402.05 2036.67 403.86 2039.47 407 L 2059.45 430 C 2060.01 431.28 2060.01 432.72 2059.45 434 L 2039.47 457 C 2036.67 460.14 2032.69 461.95 2028.49 462 L 1994.52 462 C 1990.32 461.95 1986.34 460.14 1983.54 457 L 1963.56 434 C 1963 432.72 1963 431.28 1963.56 430 L 1983.54 407 Z" fill="#99ffff" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> @@ -72,20 +72,20 @@
>         <text x="1881.75" y="870.75">
>   	TOUCH_2</text>
>       </g>
> -    <path d="M 1727.04 982 C 1729.84 978.86 1733.82 977.05 1738.02 977 L 1771.99 977 C 1776.19 977.05 1780.17 978.86 1782.97 982 L 1802.95 1005 C 1803.51 1006.28 1803.51 1007.72 1802.95 1009 L 1782.97 1032 C 1780.17 1035.14 1776.19 1036.95 1771.99 1037 L 1738.02 1037 C 1733.82 1036.95 1729.84 1035.14 1727.04 1032 L 1707.06 1009 C 1706.5 1007.72 1706.5 1006.28 1707.06 1005 L 1727.04 982 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1677.04 918 C 1679.84 914.86 1683.82 913.05 1688.02 913 L 1721.99 913 C 1726.19 913.05 1730.17 914.86 1732.97 918 L 1752.95 941 C 1753.51 942.28 1753.51 943.72 1752.95 945 L 1732.97 968 C 1730.17 971.14 1726.19 972.95 1721.99 973 L 1688.02 973 C 1683.82 972.95 1679.84 971.14 1677.04 968 L 1657.06 945 C 1656.5 943.72 1656.5 942.28 1657.06 941 L 1677.04 918 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1754.75" y="1003.75">
> +      <text x="1704.75" y="939.75">
>   	second</text>
> -      <text x="1754.75" y="1017.75">
> +      <text x="1704.75" y="953.75">
>   	finger up</text>
>       </g>
> -    <path d="M 1863.86 887 L 1786.49 972.28" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1782.97 976.17 L 1785.08 968.64 L 1786.49 972.28 L 1790.26 973.34 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1575.22 642.1 C 1576.36 638.9 1578.22 637.04 1580.18 637.12 L 1648.64 637.12 C 1650.2 637.08 1651.7 637.63 1652.67 638.61 C 1653.65 639.59 1653.99 640.88 1653.6 642.1 L 1634.75 691.9 C 1633.61 695.1 1631.75 696.96 1629.79 696.88 L 1560.34 696.88 C 1558.95 696.69 1557.73 696.05 1556.97 695.1 C 1556.22 694.15 1556 692.99 1556.37 691.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1835.42 887 L 1759.35 919.66" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1754.53 921.73 L 1759.58 915.76 L 1759.35 919.66 L 1762.34 922.19 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1281.22 397.1 C 1282.36 393.9 1284.22 392.04 1286.18 392.12 L 1354.64 392.12 C 1356.2 392.08 1357.7 392.63 1358.67 393.61 C 1359.65 394.59 1359.99 395.88 1359.6 397.1 L 1340.75 446.9 C 1339.61 450.1 1337.75 451.96 1335.79 451.88 L 1266.34 451.88 C 1264.95 451.69 1263.73 451.05 1262.97 450.1 C 1262.22 449.15 1262 447.99 1262.37 446.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1604.75" y="663.75">
> +      <text x="1310.75" y="418.75">
>   	button 2</text>
> -      <text x="1604.75" y="677.75">
> +      <text x="1310.75" y="432.75">
>   	press</text>
>       </g>
>       <path d="M 1976.54 962 C 1979.34 958.86 1983.32 957.05 1987.52 957 L 2021.49 957 C 2025.69 957.05 2029.67 958.86 2032.47 962 L 2052.45 985 C 2053.01 986.28 2053.01 987.72 2052.45 989 L 2032.47 1012 C 2029.67 1015.14 2025.69 1016.95 2021.49 1017 L 1987.52 1017 C 1983.32 1016.95 1979.34 1015.14 1976.54 1012 L 1956.56 989 C 1956 987.72 1956 986.28 1956.56 985 L 1976.54 962 Z" fill="#67ab9f" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> @@ -104,45 +104,45 @@
>       <path d="M 2080.91 915.03 L 2073.29 916.79 L 2075.81 913.8 L 2074.93 909.98 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1902.42 887 L 1969.33 952.54" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1973.08 956.22 L 1965.63 953.82 L 1969.33 952.54 L 1970.53 948.82 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1638.72 1112.1 C 1639.86 1108.9 1641.72 1107.04 1643.68 1107.12 L 1712.14 1107.12 C 1713.7 1107.08 1715.2 1107.63 1716.17 1108.61 C 1717.15 1109.59 1717.49 1110.88 1717.1 1112.1 L 1698.25 1161.9 C 1697.11 1165.1 1695.25 1166.96 1693.29 1166.88 L 1623.84 1166.88 C 1622.45 1166.69 1621.23 1166.05 1620.47 1165.1 C 1619.72 1164.15 1619.5 1162.99 1619.87 1161.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1415.72 1142.1 C 1416.86 1138.9 1418.72 1137.04 1420.68 1137.12 L 1489.14 1137.12 C 1490.7 1137.08 1492.2 1137.63 1493.17 1138.61 C 1494.15 1139.59 1494.49 1140.88 1494.1 1142.1 L 1475.25 1191.9 C 1474.11 1195.1 1472.25 1196.96 1470.29 1196.88 L 1400.84 1196.88 C 1399.45 1196.69 1398.23 1196.05 1397.47 1195.1 C 1396.72 1194.15 1396.5 1192.99 1396.87 1191.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1668.25" y="1133.75">
> +      <text x="1445.25" y="1163.75">
>   	button 1</text>
> -      <text x="1668.25" y="1147.75">
> +      <text x="1445.25" y="1177.75">
>   	release</text>
>       </g>
> -    <path d="M 1584.72 547.1 C 1585.86 543.9 1587.72 542.04 1589.68 542.12 L 1658.14 542.12 C 1659.7 542.08 1661.2 542.63 1662.17 543.61 C 1663.15 544.59 1663.49 545.88 1663.1 547.1 L 1644.25 596.9 C 1643.11 600.1 1641.25 601.96 1639.29 601.88 L 1569.84 601.88 C 1568.45 601.69 1567.23 601.05 1566.47 600.1 C 1565.72 599.15 1565.5 597.99 1565.87 596.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1317.72 297.1 C 1318.86 293.9 1320.72 292.04 1322.68 292.12 L 1391.14 292.12 C 1392.7 292.08 1394.2 292.63 1395.17 293.61 C 1396.15 294.59 1396.49 295.88 1396.1 297.1 L 1377.25 346.9 C 1376.11 350.1 1374.25 351.96 1372.29 351.88 L 1302.84 351.88 C 1301.45 351.69 1300.23 351.05 1299.47 350.1 C 1298.72 349.15 1298.5 347.99 1298.87 346.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1614.25" y="568.75">
> +      <text x="1347.25" y="318.75">
>   	button 2</text>
> -      <text x="1614.25" y="582.75">
> +      <text x="1347.25" y="332.75">
>   	release</text>
>       </g>
> -    <path d="M 1718.98 777.5 L 1640.52 701.43" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1636.75 697.78 L 1644.21 700.14 L 1640.52 701.43 L 1639.34 705.16 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1608 637 L 1610.87 608.34" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1611.39 603.11 L 1614.17 610.43 L 1610.87 608.34 L 1607.21 609.73 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <rect x="1399" y="917" width="130" height="40" rx="2.4" ry="2.4" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
> +    <path d="M 1625.58 747.5 L 1572.42 691.61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1568.8 687.81 L 1576.16 690.47 L 1572.42 691.61 L 1571.09 695.29 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1321.95 392 L 1334.37 357.98" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1336.17 353.05 L 1337.05 360.83 L 1334.37 357.98 L 1330.48 358.43 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <rect x="1167" y="895" width="130" height="40" rx="2.4" ry="2.4" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1463.75" y="940.75">
> +      <text x="1231.75" y="918.75">
>   	TAPPED</text>
>       </g>
> -    <path d="M 1528.04 1042 C 1530.84 1038.86 1534.82 1037.05 1539.02 1037 L 1572.99 1037 C 1577.19 1037.05 1581.17 1038.86 1583.97 1042 L 1603.95 1065 C 1604.51 1066.28 1604.51 1067.72 1603.95 1069 L 1583.97 1092 C 1581.17 1095.14 1577.19 1096.95 1572.99 1097 L 1539.02 1097 C 1534.82 1096.95 1530.84 1095.14 1528.04 1092 L 1508.06 1069 C 1507.5 1067.72 1507.5 1066.28 1508.06 1065 L 1528.04 1042 Z" fill="#99ffff" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1373.04 1018 C 1375.84 1014.86 1379.82 1013.05 1384.02 1013 L 1417.99 1013 C 1422.19 1013.05 1426.17 1014.86 1428.97 1018 L 1448.95 1041 C 1449.51 1042.28 1449.51 1043.72 1448.95 1045 L 1428.97 1068 C 1426.17 1071.14 1422.19 1072.95 1417.99 1073 L 1384.02 1073 C 1379.82 1072.95 1375.84 1071.14 1373.04 1068 L 1353.06 1045 C 1352.5 1043.72 1352.5 1042.28 1353.06 1041 L 1373.04 1018 Z" fill="#99ffff" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1555.75" y="1070.75">
> +      <text x="1400.75" y="1046.75">
>   	timeout</text>
>       </g>
> -    <path d="M 1478.15 957 L 1531.09 1031.8" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1534.12 1036.09 L 1527.22 1032.4 L 1531.09 1031.8 L 1532.94 1028.35 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1372.54 1012 C 1375.34 1008.86 1379.32 1007.05 1383.52 1007 L 1417.49 1007 C 1421.69 1007.05 1425.67 1008.86 1428.47 1012 L 1448.45 1035 C 1449.01 1036.28 1449.01 1037.72 1448.45 1039 L 1428.47 1062 C 1425.67 1065.14 1421.69 1066.95 1417.49 1067 L 1383.52 1067 C 1379.32 1066.95 1375.34 1065.14 1372.54 1062 L 1352.56 1039 C 1352 1037.72 1352 1036.28 1352.56 1035 L 1372.54 1012 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1258.41 935 L 1356.31 1009.16" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1360.5 1012.32 L 1352.81 1010.89 L 1356.31 1009.16 L 1357.03 1005.31 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1167.54 998 C 1170.34 994.86 1174.32 993.05 1178.52 993 L 1212.49 993 C 1216.69 993.05 1220.67 994.86 1223.47 998 L 1243.45 1021 C 1244.01 1022.28 1244.01 1023.72 1243.45 1025 L 1223.47 1048 C 1220.67 1051.14 1216.69 1052.95 1212.49 1053 L 1178.52 1053 C 1174.32 1052.95 1170.34 1051.14 1167.54 1048 L 1147.56 1025 C 1147 1023.72 1147 1022.28 1147.56 1021 L 1167.54 998 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1400.25" y="1033.75">
> +      <text x="1195.25" y="1019.75">
>   	first</text>
> -      <text x="1400.25" y="1047.75">
> +      <text x="1195.25" y="1033.75">
>   	finger down</text>
>       </g>
> -    <path d="M 1451.3 957 L 1422.96 1001.62" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1420.15 1006.06 L 1420.95 998.27 L 1422.96 1001.62 L 1426.86 1002.02 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1225.24 935 L 1207.68 986.97" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1206 991.94 L 1204.92 984.19 L 1207.68 986.97 L 1211.55 986.43 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <rect x="830" y="1487" width="130" height="40" rx="2.4" ry="2.4" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="894.75" y="1510.75">
> @@ -164,10 +164,10 @@
>       </g>
>       <path d="M 873.81 1527 L 788.41 1607.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 784.59 1611.23 L 787.28 1603.88 L 788.41 1607.63 L 792.08 1608.97 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1464 777 L 1464 910.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1464 915.88 L 1460.5 908.88 L 1464 910.63 L 1467.5 908.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1604.21 1097 L 1614.88 1103.64" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1619.34 1106.41 L 1611.54 1105.68 L 1614.88 1103.64 L 1615.24 1099.74 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1227.03 770 L 1231.1 888.64" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1231.28 893.88 L 1227.54 887.01 L 1231.1 888.64 L 1234.53 886.77 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1411.77 1073 L 1432.58 1131.01" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1434.36 1135.95 L 1428.7 1130.54 L 1432.58 1131.01 L 1435.29 1128.18 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <ellipse cx="2341" cy="810" rx="49.5" ry="30" fill="#ccccff" stroke="#000000" stroke-width="2" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="2341.25" y="813.75">
> @@ -226,18 +226,18 @@
>       </g>
>       <path d="M 1874.74 1387 L 2026.81 1517.85" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2030.79 1521.27 L 2023.2 1519.36 L 2026.81 1517.85 L 2027.76 1514.05 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1595.54 962 C 1598.34 958.86 1602.32 957.05 1606.52 957 L 1640.49 957 C 1644.69 957.05 1648.67 958.86 1651.47 962 L 1671.45 985 C 1672.01 986.28 1672.01 987.72 1671.45 989 L 1651.47 1012 C 1648.67 1015.14 1644.69 1016.95 1640.49 1017 L 1606.52 1017 C 1602.32 1016.95 1598.34 1015.14 1595.54 1012 L 1575.56 989 C 1575 987.72 1575 986.28 1575.56 985 L 1595.54 962 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1421.54 888 C 1424.34 884.86 1428.32 883.05 1432.52 883 L 1466.49 883 C 1470.69 883.05 1474.67 884.86 1477.47 888 L 1497.45 911 C 1498.01 912.28 1498.01 913.72 1497.45 915 L 1477.47 938 C 1474.67 941.14 1470.69 942.95 1466.49 943 L 1432.52 943 C 1428.32 942.95 1424.34 941.14 1421.54 938 L 1401.56 915 C 1401 913.72 1401 912.28 1401.56 911 L 1421.54 888 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1623.25" y="983.75">
> +      <text x="1449.25" y="909.75">
>   	first</text>
> -      <text x="1623.25" y="997.75">
> +      <text x="1449.25" y="923.75">
>   	finger up</text>
>       </g>
> -    <path d="M 1838.92 887 L 1677.78 961.8" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1673.01 964.01 L 1677.89 957.89 L 1677.78 961.8 L 1680.84 964.24 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <ellipse cx="1673" cy="1272" rx="49.5" ry="30" fill="#ccccff" stroke="#000000" stroke-width="2" pointer-events="none"/>
> +    <path d="M 1817 873.91 L 1504.33 907.17" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1499.11 907.72 L 1505.7 903.5 L 1504.33 907.17 L 1506.44 910.46 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <ellipse cx="1445" cy="1292" rx="49.5" ry="30" fill="#ccccff" stroke="#000000" stroke-width="2" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1672.75" y="1275.75">
> +      <text x="1444.75" y="1295.75">
>   	IDLE</text>
>       </g>
>       <path d="M 1623.04 1532 C 1625.84 1528.86 1629.82 1527.05 1634.02 1527 L 1667.99 1527 C 1672.19 1527.05 1676.17 1528.86 1678.97 1532 L 1698.95 1555 C 1699.51 1556.28 1699.51 1557.72 1698.95 1559 L 1678.97 1582 C 1676.17 1585.14 1672.19 1586.95 1667.99 1587 L 1634.02 1587 C 1629.82 1586.95 1625.84 1585.14 1623.04 1582 L 1603.06 1559 C 1602.5 1557.72 1602.5 1556.28 1603.06 1555 L 1623.04 1532 Z" fill="#ffffff" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> @@ -249,8 +249,8 @@
>       </g>
>       <path d="M 1830.39 1387 L 1687.28 1522.62" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1683.47 1526.23 L 1686.14 1518.88 L 1687.28 1522.62 L 1690.96 1523.96 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1669.5 1167 L 1671.79 1235.64" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1671.96 1240.88 L 1668.23 1234 L 1671.79 1235.64 L 1675.23 1233.77 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1445.38 1197 L 1445.15 1255.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1445.12 1260.88 L 1441.65 1253.87 L 1445.15 1255.63 L 1448.65 1253.9 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <rect x="1070.5" y="1167" width="209" height="40" rx="2.4" ry="2.4" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="1174.75" y="1190.75">
> @@ -344,8 +344,6 @@
>       <path d="M 1916.67 665.93 L 1915.29 658.22 L 1918.15 660.89 L 1922 660.2 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1886.53 817.5 L 1884.41 840.66" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1883.93 845.89 L 1881.08 838.6 L 1884.41 840.66 L 1888.05 839.23 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1802.5 669.9 L 1894.5 620.03" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1899.12 617.53 L 1894.63 623.95 L 1894.5 620.03 L 1891.3 617.79 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <rect x="2213.25" y="1117" width="130" height="40" rx="2.4" ry="2.4" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="2278" y="1140.75">
> @@ -371,7 +369,7 @@
>       <path d="M 2159.42 1221.35 L 2163.1 1214.45 L 2163.7 1218.31 L 2167.16 1220.15 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2402 872.5 L 2402 607 Q 2402 597 2392 597 L 2008.37 597" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2003.12 597 L 2010.12 593.5 L 2008.37 597 L 2010.12 600.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 2062 1082.5 L 2062 607 Q 2062 597 2052 597 L 2008.37 597" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 2062 1033.5 L 2062 607 Q 2062 597 2052 597 L 2008.37 597" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2003.12 597 L 2010.12 593.5 L 2008.37 597 L 2010.12 600.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2233.79 1232 C 2236.59 1228.86 2240.57 1227.05 2244.77 1227 L 2278.74 1227 C 2282.94 1227.05 2286.92 1228.86 2289.72 1232 L 2309.7 1255 C 2310.26 1256.28 2310.26 1257.72 2309.7 1259 L 2289.72 1282 C 2286.92 1285.14 2282.94 1286.95 2278.74 1287 L 2244.77 1287 C 2240.57 1286.95 2236.59 1285.14 2233.79 1282 L 2213.81 1259 C 2213.25 1257.72 2213.25 1256.28 2213.81 1255 L 2233.79 1232 Z" fill="#ffb570" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> @@ -558,8 +556,8 @@
>         <text x="470.25" y="1244.75">
>   	press</text>
>       </g>
> -    <path d="M 1399 955.97 L 525.11 1211.06" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="none"/>
> -    <path d="M 520.07 1212.53 L 525.81 1207.21 L 525.11 1211.06 L 527.77 1213.93 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1183.19 935 L 524.89 1204.71" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="none"/>
> +    <path d="M 520.03 1206.7 L 525.18 1200.81 L 524.89 1204.71 L 527.84 1207.29 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 241.22 2117.1 C 242.36 2113.9 244.22 2112.04 246.18 2112.12 L 314.64 2112.12 C 316.2 2112.08 317.7 2112.63 318.67 2113.61 C 319.65 2114.59 319.99 2115.88 319.6 2117.1 L 300.75 2166.9 C 299.61 2170.1 297.75 2171.96 295.79 2171.88 L 226.34 2171.88 C 224.95 2171.69 223.73 2171.05 222.97 2170.1 C 222.22 2169.15 222 2167.99 222.37 2166.9 Z" fill="#ff6666" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="270.75" y="2138.75">
> @@ -607,15 +605,15 @@
>         <text x="1732.25" y="231.75">
>   	TOUCH_TOUCH</text>
>       </g>
> -    <path d="M 1415.5 590.7 C 1431.62 596.91 1449.38 596.91 1465.5 590.7 C 1481.62 584.5 1499.38 584.5 1515.5 590.7 L 1515.5 643.28 C 1499.38 637.08 1481.62 637.08 1465.5 643.28 C 1449.38 649.49 1431.62 649.49 1415.5 643.28 L 1415.5 590.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1175.5 598.7 C 1191.62 604.91 1209.38 604.91 1225.5 598.7 C 1241.62 592.5 1259.38 592.5 1275.5 598.7 L 1275.5 651.28 C 1259.38 645.08 1241.62 645.08 1225.5 651.28 C 1209.38 657.49 1191.62 657.49 1175.5 651.28 L 1175.5 598.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1465.25" y="620.75">
> +      <text x="1225.25" y="628.75">
>   	TOUCH_IDLE</text>
>       </g>
> -    <path d="M 1464.24 462 L 1465.18 578.13" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1465.23 583.38 L 1461.67 576.41 L 1465.18 578.13 L 1468.67 576.35 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1465.13 649.5 L 1464.42 710.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1464.36 715.88 L 1460.94 708.84 L 1464.42 710.63 L 1467.94 708.92 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1426.93 462 L 1270.61 588.49" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1266.53 591.8 L 1269.77 584.67 L 1270.61 588.49 L 1274.17 590.11 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1225.64 657.5 L 1225.84 703.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1225.86 708.88 L 1222.33 701.9 L 1225.84 703.63 L 1229.33 701.87 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1733.53 162 L 1733.11 189.13" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1733.03 194.38 L 1729.64 187.33 L 1733.11 189.13 L 1736.63 187.44 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1734.24 260.5 L 1735.59 285.64" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> @@ -631,15 +629,8 @@
>       <path d="M 1957.99 494.65 L 1959.87 487.05 L 1961.4 490.66 L 1965.19 491.6 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1933.03 560.5 L 1934.14 570.67" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1934.71 575.89 L 1930.47 569.31 L 1934.14 570.67 L 1937.43 568.55 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1616.73 957 L 1606.4 911.21" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1605.25 906.09 L 1610.2 912.15 L 1606.4 911.21 L 1603.37 913.69 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1605 805 L 1605 703.37" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1605 698.12 L 1608.5 705.12 L 1605 703.37 L 1601.5 705.12 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="11px">
> -      <rect fill="#ffffff" stroke="none" x="1596" y="745" width="20" height="14" stroke-width="0"/>
> -      <text x="1605" y="754.5">
> -	yes</text>
> -    </g>
> +    <path d="M 1448.8 883 L 1447.41 823.87" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1447.29 818.62 L 1450.95 825.53 L 1447.41 823.87 L 1443.95 825.7 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2211.5 948.7 C 2227.62 954.91 2245.38 954.91 2261.5 948.7 C 2277.62 942.5 2295.38 942.5 2311.5 948.7 L 2311.5 1001.28 C 2295.38 995.08 2277.62 995.08 2261.5 1001.28 C 2245.38 1007.49 2227.62 1007.49 2211.5 1001.28 L 2211.5 948.7 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="2261.25" y="978.75">
> @@ -667,27 +658,20 @@
>       <path d="M 1896.37 751.4 L 1894.35 743.85 L 1897.42 746.26 L 1901.2 745.25 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1662.58 462 L 1863.01 747.29" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1866.02 751.59 L 1859.14 747.87 L 1863.01 747.29 L 1864.86 743.85 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1702.5 670.7 C 1718.62 676.91 1736.38 676.91 1752.5 670.7 C 1768.62 664.5 1786.38 664.5 1802.5 670.7 L 1802.5 723.28 C 1786.38 717.08 1768.62 717.08 1752.5 723.28 C 1736.38 729.49 1718.62 729.49 1702.5 723.28 L 1702.5 670.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1606.5 753.7 C 1622.62 759.91 1640.38 759.91 1656.5 753.7 C 1672.62 747.5 1690.38 747.5 1706.5 753.7 L 1706.5 806.28 C 1690.38 800.08 1672.62 800.08 1656.5 806.28 C 1640.38 812.49 1622.62 812.49 1606.5 806.28 L 1606.5 753.7 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1752.25" y="700.75">
> +      <text x="1656.25" y="783.75">
>   	TOUCH_IDLE</text>
>       </g>
> -    <path d="M 1647.62 602 L 1711.9 660.22" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1715.79 663.75 L 1708.25 661.64 L 1711.9 660.22 L 1712.95 656.46 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1702.5 783.7 C 1718.62 789.91 1736.38 789.91 1752.5 783.7 C 1768.62 777.5 1786.38 777.5 1802.5 783.7 L 1802.5 836.28 C 1786.38 830.08 1768.62 830.08 1752.5 836.28 C 1736.38 842.49 1718.62 842.49 1702.5 836.28 L 1702.5 783.7 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1696.07 913 L 1667.99 818.6" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1666.49 813.57 L 1671.84 819.28 L 1667.99 818.6 L 1665.13 821.28 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 2003.5 1039.7 C 2019.62 1045.91 2037.38 1045.91 2053.5 1039.7 C 2069.62 1033.5 2087.38 1033.5 2103.5 1039.7 L 2103.5 1092.28 C 2087.38 1086.08 2069.62 1086.08 2053.5 1092.28 C 2037.38 1098.49 2019.62 1098.49 2003.5 1092.28 L 2003.5 1039.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1752.25" y="813.75">
> +      <text x="2053.25" y="1069.75">
>   	TOUCH_IDLE</text>
>       </g>
> -    <path d="M 1754.62 977 L 1752.99 848.87" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1752.93 843.62 L 1756.52 850.57 L 1752.99 848.87 L 1749.52 850.66 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 2011.5 1088.7 C 2027.62 1094.91 2045.38 1094.91 2061.5 1088.7 C 2077.62 1082.5 2095.38 1082.5 2111.5 1088.7 L 2111.5 1141.28 C 2095.38 1135.08 2077.62 1135.08 2061.5 1141.28 C 2045.38 1147.49 2027.62 1147.49 2011.5 1141.28 L 2011.5 1088.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> -    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="2061.25" y="1118.75">
> -	TOUCH_IDLE</text>
> -    </g>
> -    <path d="M 2104.26 1222 L 2076.85 1153.41" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 2074.9 1148.54 L 2080.75 1153.74 L 2076.85 1153.41 L 2074.25 1156.34 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 2106.13 1222 L 2066.5 1104.53" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 2064.82 1099.56 L 2070.38 1105.07 L 2066.5 1104.53 L 2063.74 1107.31 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1986.5 1320.7 C 2002.62 1326.91 2020.38 1326.91 2036.5 1320.7 C 2052.62 1314.5 2070.38 1314.5 2086.5 1320.7 L 2086.5 1373.28 C 2070.38 1367.08 2052.62 1367.08 2036.5 1373.28 C 2020.38 1379.49 2002.62 1379.49 1986.5 1373.28 L 1986.5 1320.7 Z" fill="#ffb570" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="2036.25" y="1350.75">
> @@ -736,8 +720,8 @@
>         <text x="1302.25" y="1120.75">
>   	TOUCH_TOUCH</text>
>       </g>
> -    <path d="M 1363.75 1067 L 1347.25 1080.47" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1343.18 1083.79 L 1346.39 1076.66 L 1347.25 1080.47 L 1350.81 1082.08 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1229.65 1053 L 1260.72 1080.3" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1264.67 1083.76 L 1257.1 1081.77 L 1260.72 1080.3 L 1261.72 1076.51 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 594 984.2 C 610.12 990.41 627.88 990.41 644 984.2 C 660.12 978 677.88 978 694 984.2 L 694 1036.78 C 677.88 1030.58 660.12 1030.58 644 1036.78 C 627.88 1042.99 610.12 1042.99 594 1036.78 L 594 984.2 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="643.75" y="1014.25">
> @@ -860,13 +844,6 @@
>       </g>
>       <path d="M 945.5 2230 L 964.51 2236.84" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 969.45 2238.62 L 961.68 2239.54 L 964.51 2236.84 L 964.05 2232.96 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1604.5 805 L 1668 855 L 1604.5 905 L 1541 855 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> -    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> -      <text x="1604.25" y="851.75">
> -	state ==</text>
> -      <text x="1604.25" y="865.75">
> -	TOUCH_TOUCH</text>
> -    </g>
>       <path d="M 1803.5 1650 L 1867 1700 L 1803.5 1750 L 1740 1700 Z" fill="#e1d5e7" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="1803.25" y="1696.75">
> @@ -874,13 +851,6 @@
>         <text x="1803.25" y="1710.75">
>   	TOUCH_TOUCH</text>
>       </g>
> -    <path d="M 1651.34 805 L 1717.7 734.15" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <path d="M 1721.29 730.32 L 1719.06 737.82 L 1717.7 734.15 L 1713.95 733.03 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> -    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="11px">
> -      <rect fill="#ffffff" stroke="none" x="1680" y="761" width="14" height="14" stroke-width="0"/>
> -      <text x="1686.88" y="770.55">
> -	no</text>
> -    </g>
>       <path d="M 2213.5 1013.7 C 2229.62 1019.91 2247.38 1019.91 2263.5 1013.7 C 2279.62 1007.5 2297.38 1007.5 2313.5 1013.7 L 2313.5 1066.28 C 2297.38 1060.08 2279.62 1060.08 2263.5 1066.28 C 2247.38 1072.49 2229.62 1072.49 2213.5 1066.28 L 2213.5 1013.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
>       <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
>         <text x="2263.25" y="1043.75">
> @@ -1197,5 +1167,98 @@
>       <path d="M 2326.89 778.99 L 2320.74 774.15 L 2324.65 774.24 L 2327.07 771.16 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 1959.61 577 L 2084.82 466.22" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>       <path d="M 2088.75 462.74 L 2085.83 470 L 2084.82 466.22 L 2081.19 464.76 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <rect x="1472" y="647" width="154" height="40" rx="2.4" ry="2.4" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1548.75" y="670.75">
> +	TOUCH_2_RELEASE</text>
> +    </g>
> +    <path d="M 1401.04 572 C 1403.84 568.86 1407.82 567.05 1412.02 567 L 1445.99 567 C 1450.19 567.05 1454.17 568.86 1456.97 572 L 1476.95 595 C 1477.51 596.28 1477.51 597.72 1476.95 599 L 1456.97 622 C 1454.17 625.14 1450.19 626.95 1445.99 627 L 1412.02 627 C 1407.82 626.95 1403.84 625.14 1401.04 622 L 1381.06 599 C 1380.5 597.72 1380.5 596.28 1381.06 595 L 1401.04 572 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1428.75" y="593.75">
> +	second</text>
> +      <text x="1428.75" y="607.75">
> +	finger up</text>
> +    </g>
> +    <path d="M 1514.71 647 L 1483 628.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1478.47 625.85 L 1486.28 626.36 L 1483 628.5 L 1482.75 632.41 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1694.54 600 C 1697.34 596.86 1701.32 595.05 1705.52 595 L 1739.49 595 C 1743.69 595.05 1747.67 596.86 1750.47 600 L 1770.45 623 C 1771.01 624.28 1771.01 625.72 1770.45 627 L 1750.47 650 C 1747.67 653.14 1743.69 654.95 1739.49 655 L 1705.52 655 C 1701.32 654.95 1697.34 653.14 1694.54 650 L 1674.56 627 C 1674 625.72 1674 624.28 1674.56 623 L 1694.54 600 Z" fill="#99ffff" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1722.25" y="628.75">
> +	timeout</text>
> +    </g>
> +    <path d="M 1626 648.36 L 1667.81 638.24" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1672.91 637 L 1666.93 642.05 L 1667.81 638.24 L 1665.29 635.25 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1708.54 693 C 1711.34 689.86 1715.32 688.05 1719.52 688 L 1753.49 688 C 1757.69 688.05 1761.67 689.86 1764.47 693 L 1784.45 716 C 1785.01 717.28 1785.01 718.72 1784.45 720 L 1764.47 743 C 1761.67 746.14 1757.69 747.95 1753.49 748 L 1719.52 748 C 1715.32 747.95 1711.34 746.14 1708.54 743 L 1688.56 720 C 1688 718.72 1688 717.28 1688.56 716 L 1708.54 693 Z" fill="#67ab9f" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1736.25" y="714.75">
> +	move > </text>
> +      <text x="1736.25" y="728.75">
> +	threshold</text>
> +    </g>
> +    <path d="M 1622.53 687 L 1681.86 703.14" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1686.92 704.51 L 1679.25 706.05 L 1681.86 703.14 L 1681.09 699.3 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1771 618.67 L 1865.69 606.31" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1870.89 605.63 L 1864.4 610.01 L 1865.69 606.31 L 1863.5 603.07 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1785 688.73 L 1898.41 620.29" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1902.9 617.58 L 1898.72 624.19 L 1898.41 620.29 L 1895.1 618.2 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1408.77 567 L 1334.79 457.28" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1331.85 452.93 L 1338.67 456.77 L 1334.79 457.28 L 1332.87 460.69 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1596.04 983 C 1598.84 979.86 1602.82 978.05 1607.02 978 L 1640.99 978 C 1645.19 978.05 1649.17 979.86 1651.97 983 L 1671.95 1006 C 1672.51 1007.28 1672.51 1008.72 1671.95 1010 L 1651.97 1033 C 1649.17 1036.14 1645.19 1037.95 1640.99 1038 L 1607.02 1038 C 1602.82 1037.95 1598.84 1036.14 1596.04 1033 L 1576.06 1010 C 1575.5 1008.72 1575.5 1007.28 1576.06 1006 L 1596.04 983 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1623.75" y="1004.75">
> +	first</text>
> +      <text x="1623.75" y="1018.75">
> +	finger down</text>
> +    </g>
> +    <path d="M 1553.4 687 L 1616.03 971.78" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1617.16 976.91 L 1612.24 970.82 L 1616.03 971.78 L 1619.08 969.32 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1387.07 292 L 1685.36 65.85" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1689.54 62.68 L 1686.08 69.69 L 1685.36 65.85 L 1681.85 64.12 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1396.5 758.7 C 1412.62 764.91 1430.38 764.91 1446.5 758.7 C 1462.62 752.5 1480.38 752.5 1496.5 758.7 L 1496.5 811.28 C 1480.38 805.08 1462.62 805.08 1446.5 811.28 C 1430.38 817.49 1412.62 817.49 1396.5 811.28 L 1396.5 758.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1446.25" y="788.75">
> +	TOUCH_IDLE</text>
> +    </g>
> +    <path d="M 1474.73 752.5 L 1527.45 691.81" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1530.89 687.84 L 1528.95 695.42 L 1527.45 691.81 L 1523.66 690.83 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1492.54 520 C 1495.34 516.86 1499.32 515.05 1503.52 515 L 1537.49 515 C 1541.69 515.05 1545.67 516.86 1548.47 520 L 1568.45 543 C 1569.01 544.28 1569.01 545.72 1568.45 547 L 1548.47 570 C 1545.67 573.14 1541.69 574.95 1537.49 575 L 1503.52 575 C 1499.32 574.95 1495.34 573.14 1492.54 570 L 1472.56 547 C 1472 545.72 1472 544.28 1472.56 543 L 1492.54 520 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1520.25" y="541.75">
> +	first</text>
> +      <text x="1520.25" y="555.75">
> +	finger up</text>
> +    </g>
> +    <path d="M 1544.33 647 L 1528.96 581.2" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1527.76 576.09 L 1532.76 582.11 L 1528.96 581.2 L 1525.95 583.7 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1472 516.53 L 1365.49 453.99" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1360.96 451.33 L 1368.77 451.86 L 1365.49 453.99 L 1365.23 457.9 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1521.54 1043 C 1524.34 1039.86 1528.32 1038.05 1532.52 1038 L 1566.49 1038 C 1570.69 1038.05 1574.67 1039.86 1577.47 1043 L 1597.45 1066 C 1598.01 1067.28 1598.01 1068.72 1597.45 1070 L 1577.47 1093 C 1574.67 1096.14 1570.69 1097.95 1566.49 1098 L 1532.52 1098 C 1528.32 1097.95 1524.34 1096.14 1521.54 1093 L 1501.56 1070 C 1501 1068.72 1501 1067.28 1501.56 1066 L 1521.54 1043 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1549.25" y="1064.75">
> +	second</text>
> +      <text x="1549.25" y="1078.75">
> +	finger down</text>
> +    </g>
> +    <path d="M 1549.02 687 L 1549.45 1031.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1549.46 1036.88 L 1545.95 1029.89 L 1549.45 1031.63 L 1552.95 1029.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1680.5 1110.7 C 1696.62 1116.91 1714.38 1116.91 1730.5 1110.7 C 1746.62 1104.5 1764.38 1104.5 1780.5 1110.7 L 1780.5 1163.28 C 1764.38 1157.08 1746.62 1157.08 1730.5 1163.28 C 1714.38 1169.49 1696.62 1169.49 1680.5 1163.28 L 1680.5 1110.7 Z" fill="#7ea6e0" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1730.25" y="1140.75">
> +	TOUCH_DEAD</text>
> +    </g>
> +    <path d="M 1692.5 1049.7 C 1708.62 1055.91 1726.38 1055.91 1742.5 1049.7 C 1758.62 1043.5 1776.38 1043.5 1792.5 1049.7 L 1792.5 1102.28 C 1776.38 1096.08 1758.62 1096.08 1742.5 1102.28 C 1726.38 1108.49 1708.62 1108.49 1692.5 1102.28 L 1692.5 1049.7 Z" fill="#ffd966" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
> +    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
> +      <text x="1742.25" y="1079.75">
> +	TOUCH_DEAD</text>
> +    </g>
> +    <path d="M 1672.5 1035.83 L 1686.98 1044.14" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1691.53 1046.75 L 1683.72 1046.3 L 1686.98 1044.14 L 1687.2 1040.23 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1792.5 1081.69 L 2206.92 1128.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 2212.14 1129.47 L 2204.79 1132.16 L 2206.92 1128.88 L 2205.58 1125.2 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1598 1086.49 L 1674.55 1115.67" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1679.46 1117.54 L 1671.67 1118.32 L 1674.55 1115.67 L 1674.16 1111.78 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 1780.5 1137 L 2206.88 1137" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
> +    <path d="M 2212.13 1137 L 2205.13 1140.5 L 2206.88 1137 L 2205.13 1133.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
>     </g>
>   </svg>
> +
> diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
> index de4945e..753fc6b 100644
> --- a/src/evdev-mt-touchpad-tap.c
> +++ b/src/evdev-mt-touchpad-tap.c
> @@ -69,6 +69,7 @@ tap_state_to_str(enum tp_tap_state state)
>   	CASE_RETURN_STRING(TAP_STATE_TAPPED);
>   	CASE_RETURN_STRING(TAP_STATE_TOUCH_2);
>   	CASE_RETURN_STRING(TAP_STATE_TOUCH_2_HOLD);
> +	CASE_RETURN_STRING(TAP_STATE_TOUCH_2_RELEASE);
>   	CASE_RETURN_STRING(TAP_STATE_TOUCH_3);
>   	CASE_RETURN_STRING(TAP_STATE_TOUCH_3_HOLD);
>   	CASE_RETURN_STRING(TAP_STATE_DRAGGING);
> @@ -275,12 +276,8 @@ tp_tap_touch2_handle_event(struct tp_dispatch *tp,
>   		tp_tap_set_timer(tp, time);
>   		break;
>   	case TAP_EVENT_RELEASE:
> -		tp->tap.state = TAP_STATE_HOLD;
> -		if (t->tap.state == TAP_TOUCH_STATE_TOUCH) {
> -			tp_tap_notify(tp, time, 2, LIBINPUT_BUTTON_STATE_PRESSED);
> -			tp_tap_notify(tp, time, 2, LIBINPUT_BUTTON_STATE_RELEASED);
> -		}
> -		tp_tap_clear_timer(tp);
> +		tp->tap.state = TAP_STATE_TOUCH_2_RELEASE;
> +		tp_tap_set_timer(tp, time);
>   		break;
>   	case TAP_EVENT_MOTION:
>   		tp_tap_clear_timer(tp);
> @@ -323,6 +320,35 @@ tp_tap_touch2_hold_handle_event(struct tp_dispatch *tp,
>   }
>
>   static void
> +tp_tap_touch2_release_handle_event(struct tp_dispatch *tp,
> +				   struct tp_touch *t,
> +				   enum tap_event event, uint64_t time)
> +{
> +
> +	switch (event) {
> +	case TAP_EVENT_TOUCH:
> +		tp->tap.state = TAP_STATE_TOUCH_2_HOLD;
> +		t->tap.state = TAP_TOUCH_STATE_DEAD;
> +		tp_tap_clear_timer(tp);
> +		break;
> +	case TAP_EVENT_RELEASE:
> +		tp_tap_notify(tp, time, 2, LIBINPUT_BUTTON_STATE_PRESSED);
> +		tp_tap_notify(tp, time, 2, LIBINPUT_BUTTON_STATE_RELEASED);
> +		tp->tap.state = TAP_STATE_IDLE;
> +		break;
> +	case TAP_EVENT_MOTION:
> +	case TAP_EVENT_TIMEOUT:
> +		tp->tap.state = TAP_STATE_HOLD;
> +		break;
> +	case TAP_EVENT_BUTTON:
> +		tp->tap.state = TAP_STATE_DEAD;
> +		break;
> +	case TAP_EVENT_THUMB:
> +		break;
> +	}
> +}
> +
> +static void
>   tp_tap_touch3_handle_event(struct tp_dispatch *tp,
>   			   struct tp_touch *t,
>   			   enum tap_event event, uint64_t time)
> @@ -649,6 +675,9 @@ tp_tap_handle_event(struct tp_dispatch *tp,
>   	case TAP_STATE_TOUCH_2_HOLD:
>   		tp_tap_touch2_hold_handle_event(tp, t, event, time);
>   		break;
> +	case TAP_STATE_TOUCH_2_RELEASE:
> +		tp_tap_touch2_release_handle_event(tp, t, event, time);
> +		break;
>   	case TAP_STATE_TOUCH_3:
>   		tp_tap_touch3_handle_event(tp, t, event, time);
>   		break;
> diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
> index 5f87c3f..f42fb02 100644
> --- a/src/evdev-mt-touchpad.h
> +++ b/src/evdev-mt-touchpad.h
> @@ -97,6 +97,7 @@ enum tp_tap_state {
>   	TAP_STATE_TAPPED,
>   	TAP_STATE_TOUCH_2,
>   	TAP_STATE_TOUCH_2_HOLD,
> +	TAP_STATE_TOUCH_2_RELEASE,
>   	TAP_STATE_TOUCH_3,
>   	TAP_STATE_TOUCH_3_HOLD,
>   	TAP_STATE_DRAGGING_OR_DOUBLETAP,
> diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c
> index 62c7a5c..334d797 100644
> --- a/test/touchpad-tap.c
> +++ b/test/touchpad-tap.c
> @@ -966,6 +966,50 @@ START_TEST(touchpad_2fg_tap_inverted)
>   }
>   END_TEST
>
> +START_TEST(touchpad_2fg_tap_n_hold_first)
> +{
> +	struct litest_device *dev = litest_current_device();
> +	struct libinput *li = dev->libinput;
> +
> +	litest_enable_tap(dev->libinput_device);
> +
> +	litest_drain_events(dev->libinput);
> +
> +	litest_touch_down(dev, 0, 50, 50);
> +	litest_touch_down(dev, 1, 70, 70);
> +	litest_touch_up(dev, 1);
> +
> +	libinput_dispatch(li);
> +
> +	litest_assert_empty_queue(li);
> +	litest_timeout_tap();
> +
> +	litest_assert_empty_queue(li);
> +}
> +END_TEST
> +
> +START_TEST(touchpad_2fg_tap_n_hold_second)
> +{
> +	struct litest_device *dev = litest_current_device();
> +	struct libinput *li = dev->libinput;
> +
> +	litest_enable_tap(dev->libinput_device);
> +
> +	litest_drain_events(dev->libinput);
> +
> +	litest_touch_down(dev, 0, 50, 50);
> +	litest_touch_down(dev, 1, 70, 70);
> +	litest_touch_up(dev, 0);
> +
> +	libinput_dispatch(li);
> +
> +	litest_assert_empty_queue(li);
> +	litest_timeout_tap();
> +
> +	litest_assert_empty_queue(li);
> +}
> +END_TEST
> +
>   START_TEST(touchpad_2fg_tap_quickrelease)
>   {
>   	struct litest_device *dev = litest_current_device();
> @@ -1755,6 +1799,8 @@ litest_setup_tests(void)
>   	litest_add("touchpad:tap", touchpad_2fg_tap_n_drag_3fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
>   	litest_add("touchpad:tap", touchpad_2fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
>   	litest_add("touchpad:tap", touchpad_2fg_tap_inverted, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
> +	litest_add("touchpad:tap", touchpad_2fg_tap_n_hold_first, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
> +	litest_add("touchpad:tap", touchpad_2fg_tap_n_hold_second, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
>   	litest_add("touchpad:tap", touchpad_2fg_tap_quickrelease, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
>   	litest_add("touchpad:tap", touchpad_1fg_tap_click, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD);
>   	litest_add("touchpad:tap", touchpad_2fg_tap_click, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_SINGLE_TOUCH|LITEST_CLICKPAD);
>


More information about the wayland-devel mailing list