summaryrefslogtreecommitdiff
path: root/doc/touchpad-softbutton-state-machine.svg
blob: ffa17a29dc4fb33bc5956534c40b15077b10e94f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="2180px" height="1624px" version="1.1">
  <defs/>
  <g transform="translate(0.5,0.5)">
    <path d="M 862 441 L 894 441" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 899 441 L 892 445 L 894 441 L 892 438 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <ellipse cx="785" cy="151" 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="785" y="141">NONE</text>
      <text x="785" y="155">on-entry:</text>
      <text x="785" y="169">curr = none</text>
    </g>
    <rect x="712" y="391" width="150" height="101" rx="6" ry="6" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="787" y="431">BOTTOM</text>
      <text x="787" y="445">on-entry:</text>
      <text x="787" y="459">curr = button</text>
    </g>
    <rect x="1023" y="392" width="130" height="100" rx="6" ry="6" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1088" y="425">AREA</text>
      <text x="1088" y="439">on-entry:</text>
      <text x="1088" y="453">curr =area</text>
      <text x="1088" y="467">set_pointer()</text>
    </g>
    <path d="M 921 411 C 923 408 927 405 932 405 L 965 405 C 970 405 974 408 976 411 L 996 439 C 997 440 997 442 996 444 L 976 471 C 974 475 970 477 965 477 L 932 477 C 927 477 923 475 921 471 L 901 444 C 900 442 900 440 901 439 L 921 411 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="949" y="438">finger in</text>
      <text x="949" y="452">area or top</text>
    </g>
    <path d="M 759 7 C 762 4 766 2 770 2 L 804 2 C 808 2 812 4 815 7 L 835 30 C 836 31 836 33 835 34 L 815 57 C 812 60 808 62 804 62 L 770 62 C 766 62 762 60 759 57 L 739 34 C 739 33 739 31 739 30 L 759 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="787" y="29">finger</text>
      <text x="787" y="43">up</text>
    </g>
    <path d="M 997 441 L 1016 442" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1022 442 L 1015 445 L 1016 442 L 1015 438 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 766 235 C 768 232 771 230 774 230 L 800 230 C 803 230 806 232 808 235 L 824 259 C 824 260 824 262 824 263 L 808 287 C 806 290 803 292 800 292 L 774 292 C 771 292 768 290 766 287 L 750 263 C 750 262 750 260 750 259 L 766 235 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="787" y="258">finger in</text>
      <text x="787" y="272">bottom</text>
    </g>
    <path d="M 785 181 L 786 224" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 786 229 L 783 222 L 786 224 L 790 222 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 787 292 L 787 384" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 787 390 L 784 383 L 787 384 L 791 383 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1068 236 C 1070 233 1073 231 1076 231 L 1100 231 C 1103 231 1105 233 1107 236 L 1121 259 C 1122 261 1122 262 1121 263 L 1107 287 C 1105 290 1103 292 1100 292 L 1076 292 C 1073 292 1070 290 1068 287 L 1054 263 C 1054 262 1054 261 1054 259 L 1068 236 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="1088" y="258">finger in</text>
      <text x="1088" y="272">area</text>
    </g>
    <path d="M 1088 292 L 1088 386" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1088 391 L 1084 384 L 1088 386 L 1091 384 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 834 151 L 1048 246" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1053 248 L 1045 249 L 1048 246 L 1048 242 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 922 563 C 925 559 930 556 934 556 L 971 556 C 975 556 980 559 983 563 L 1004 594 C 1005 595 1005 597 1004 599 L 983 630 C 980 634 975 636 971 636 L 934 636 C 930 636 925 634 922 630 L 901 599 C 900 597 900 595 901 594 L 922 563 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="952" y="586">finger in</text>
      <text x="952" y="600">bottom</text>
      <text x="952" y="614">button != curr</text>
    </g>
    <path d="M 927 558 L 872 487" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 869 483 L 876 486 L 872 487 L 870 491 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 808 492 L 895 555" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 899 558 L 891 557 L 895 555 L 895 551 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1153 442 L 1358 442 Q 1368 442 1368 432 L 1368 42 Q 1368 32 1358 32 L 842 32" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 837 32 L 844 29 L 842 32 L 844 36 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 712 441 L 668 441 Q 658 441 658 451 L 658 762" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 786 62 L 786 81 Q 786 91 786 101 L 786 114" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 786 120 L 783 113 L 786 114 L 790 113 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="1753" y="412" width="120" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="429">Check state of</text>
      <text x="1813" y="443">all touches</text>
    </g>
    <path d="M 1813 452 L 1813 458 Q 1813 465 1813 470 L 1813 475" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 467 L 1813 476 L 1818 467" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <ellipse cx="1813" cy="72" rx="11" ry="11" fill="#000000" stroke="#ff0000" pointer-events="none"/>
    <path d="M 1813 87 L 1813 115 Q 1813 125 1813 135 L 1813 160" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 152 L 1813 161 L 1818 152" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="1763" y="17" width="100" height="40" fill="none" stroke="none" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="41">tp_post_softbutton_buttons()</text>
    </g>
    <path d="M 1813 192 L 1908 247 L 1813 302 L 1718 247 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="244">!buttons.click_pend</text>
      <text x="1813" y="258">&amp;&amp; current == old</text>
    </g>
    <path d="M 1908 247 L 1968 247 Q 1978 247 1988 247 L 2056 247" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 2048 252 L 2057 247 L 2048 243" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1998" y="228" width="24" height="18" stroke-width="0"/>
      <text x="1999" y="241">yes</text>
    </g>
    <path d="M 1813 302 L 1813 307 Q 1813 313 1813 317 L 1813 321" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 313 L 1813 322 L 1818 313" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1830" y="310" width="18" height="18" stroke-width="0"/>
      <text x="1830" y="319">no</text>
    </g>
    <ellipse cx="2073" cy="247" rx="11" ry="11" fill="#000000" stroke="#ff0000" pointer-events="none"/>
    <ellipse cx="2073" cy="247" rx="15" ry="15" fill="transparent" stroke="#ff0000" pointer-events="none"/>
    <rect x="1713" y="102" width="200" height="70" rx="28" ry="28" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="120">current = buttons.state &amp; 0x01</text>
      <text x="1813" y="134">old = buttons.old_state &amp; 0x01</text>
      <text x="1813" y="148">button = 0</text>
      <text x="1813" y="162">is_top = 0</text>
    </g>
    <path d="M 1813 172 L 1813 177 Q 1813 182 1813 186 L 1813 190" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 182 L 1813 191 L 1818 182" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1813 568 L 1918 626 L 1813 684 L 1708 626 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="630">All touches are in state none</text>
    </g>
    <path d="M 1813 684 L 1813 691 Q 1813 697 1813 702 L 1813 708" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 700 L 1813 709 L 1818 700" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1820" y="691" width="18" height="18" stroke-width="0"/>
      <text x="1820" y="704">no</text>
    </g>
    <path d="M 1918 626 L 1936 626 Q 1946 626 1955 626 L 1971 626" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1963 631 L 1972 626 L 1963 622" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1920" y="634" width="24" height="18" stroke-width="0"/>
      <text x="1920" y="643">yes</text>
    </g>
    <rect x="1973" y="606" width="150" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="2048" y="630">buttons.click_pend = 1</text>
    </g>
    <path d="M 2123 626 L 2128 626 Q 2133 626 2137 626 L 2141 626" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 2133 631 L 2142 626 L 2133 622" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1813 710 L 1938 795 L 1813 880 L 1688 795 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="785">(Some touches are in middle) ||</text>
      <text x="1813" y="799">((Some touches are in right) &amp;&amp;</text>
      <text x="1813" y="813">(Some touches are in left))</text>
    </g>
    <path d="M 1938 795 L 1943 795 Q 1948 795 1957 795 L 1966 795" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1958 800 L 1967 795 L 1958 791" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1941" y="803" width="24" height="18" stroke-width="0"/>
      <text x="1942" y="812">yes</text>
    </g>
    <rect x="1968" y="775" width="160" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="2048" y="799">button = BTN_MIDDLE</text>
    </g>
    <path d="M 2128 795 L 2158 795 Q 2168 795 2168 805 L 2168 1197 Q 2168 1207 2158 1207 L 1913 1207" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1921 1203 L 1912 1207 L 1921 1212" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1813 323 L 1876 357 L 1813 392 L 1751 357 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="361">current</text>
    </g>
    <path d="M 1751 357 L 1606 357 Q 1596 357 1596 367 L 1596 1160" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1592 1152 L 1596 1161 L 1601 1152" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1687" y="338" width="18" height="18" stroke-width="0"/>
      <text x="1687" y="351">no</text>
    </g>
    <path d="M 1813 392 L 1813 397 Q 1813 402 1813 406 L 1813 410" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 402 L 1813 411 L 1818 402" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1830" y="390" width="24" height="18" stroke-width="0"/>
      <text x="1830" y="399">yes</text>
    </g>
    <path d="M 1813 902 L 1909 967 L 1813 1032 L 1717 967 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="971">Some touches are in right</text>
    </g>
    <path d="M 1909 967 L 1928 967 Q 1938 967 1948 967 L 1966 967" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1958 972 L 1967 967 L 1958 963" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1930" y="975" width="24" height="18" stroke-width="0"/>
      <text x="1930" y="984">yes</text>
    </g>
    <path d="M 1813 880 L 1813 886 Q 1813 891 1813 895 L 1813 900" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 892 L 1813 901 L 1818 892" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1820" y="883" width="18" height="18" stroke-width="0"/>
      <text x="1820" y="896">no</text>
    </g>
    <rect x="1968" y="947" width="160" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="2048" y="971">button = BTN_RIGHT</text>
    </g>
    <rect x="1733" y="1082" width="160" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="1106">button = BTN_LEFT</text>
    </g>
    <path d="M 1813 1032 L 1813 1047 Q 1813 1057 1813 1067 L 1813 1080" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 1072 L 1813 1081 L 1818 1072" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1815" y="1040" width="18" height="18" stroke-width="0"/>
      <text x="1815" y="1053">no</text>
    </g>
    <rect x="1716" y="1162" width="195" height="90" rx="36" ry="36" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1814" y="1197">buttons.active = button</text>
      <text x="1814" y="1211">buttons.active_is_top = is_top</text>
      <text x="1814" y="1225">state = BUTTON_PRESSED</text>
    </g>
    <path d="M 1814 1252 L 1814 1282 Q 1814 1292 1804 1292 L 1713 1292 Q 1703 1292 1703 1302 L 1703 1330" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1699 1322 L 1703 1331 L 1708 1322" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1813 1122 L 1813 1122 Q 1813 1122 1813 1132 L 1813 1152 Q 1813 1162 1813 1161 L 1813 1160" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 1152 L 1813 1161 L 1818 1152" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 2128 967 L 2158 967 Q 2168 967 2168 977 L 2168 1197 Q 2168 1207 2158 1207 L 1913 1207" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1921 1203 L 1912 1207 L 1921 1212" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="1493" y="1162" width="205" height="90" rx="36" ry="36" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1596" y="1183">button = buttons.active</text>
      <text x="1596" y="1197">is_top = buttons.active_is_top</text>
      <text x="1596" y="1211">buttons.active = 0</text>
      <text x="1596" y="1225">buttons.active_is_top = 0</text>
      <text x="1596" y="1239">state = BUTTON_RELEASED</text>
    </g>
    <rect x="1628" y="1332" width="150" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1703" y="1356">buttons.click_pend = 0</text>
    </g>
    <path d="M 1703 1372 L 1703 1380 Q 1703 1387 1703 1393 L 1703 1400" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1699 1392 L 1703 1401 L 1708 1392" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1596 1252 L 1596 1282 Q 1596 1292 1606 1292 L 1693 1292 Q 1703 1292 1703 1302 L 1703 1330" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1699 1322 L 1703 1331 L 1708 1322" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1703 1402 L 1743 1422 L 1703 1442 L 1663 1422 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1703" y="1426">button</text>
    </g>
    <path d="M 1743 1422 L 1808 1422 Q 1818 1422 1818 1432 L 1818 1597 Q 1818 1607 1808 1607 L 1720 1607" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1728 1603 L 1719 1607 L 1728 1612" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1745" y="1403" width="18" height="18" stroke-width="0"/>
      <text x="1745" y="1416">no</text>
    </g>
    <path d="M 1703 1442 L 1703 1452 Q 1703 1462 1703 1471 L 1703 1480" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1699 1472 L 1703 1481 L 1708 1472" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1705" y="1450" width="24" height="18" stroke-width="0"/>
      <text x="1705" y="1459">yes</text>
    </g>
    <rect x="1618" y="1482" width="170" height="40" rx="16" ry="16" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1703" y="1499">tp_notify_softbutton(</text>
      <text x="1703" y="1513">button, is_top, state)</text>
    </g>
    <path d="M 1703 1522 L 1703 1542 Q 1703 1552 1703 1562 L 1703 1590" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1699 1582 L 1703 1591 L 1708 1582" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <ellipse cx="1703" cy="1607" rx="11" ry="11" fill="#000000" stroke="#ff0000" pointer-events="none"/>
    <ellipse cx="1703" cy="1607" rx="15" ry="15" fill="transparent" stroke="#ff0000" pointer-events="none"/>
    <ellipse cx="2158" cy="626" rx="11" ry="11" fill="#000000" stroke="#ff0000" pointer-events="none"/>
    <ellipse cx="2158" cy="626" rx="15" ry="15" fill="transparent" stroke="#ff0000" pointer-events="none"/>
    <path d="M 456 232 C 458 229 461 227 464 227 L 490 227 C 493 227 496 229 498 232 L 514 256 C 514 257 514 259 514 260 L 498 284 C 496 287 493 289 490 289 L 464 289 C 461 289 458 287 456 284 L 440 260 C 440 259 440 257 440 256 L 456 232 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="477" y="255">finger in</text>
      <text x="477" y="269">top</text>
    </g>
    <path d="M 735 151 L 520 243" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 515 245 L 520 239 L 520 243 L 523 245 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="402" y="392" width="150" height="101" rx="6" ry="6" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="477" y="425">TOP_NEW</text>
      <text x="477" y="439">on-entry:</text>
      <text x="477" y="453">curr = button</text>
      <text x="477" y="467">start enter timeout</text>
    </g>
    <path d="M 477 289 L 477 330 Q 477 340 477 350 L 477 385" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 477 391 L 473 384 L 477 385 L 480 384 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 552 442 L 648 442 Q 658 442 658 452 L 658 762" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="412" y="712" width="130" height="100" rx="6" ry="6" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="477" y="766">TOP</text>
    </g>
    <path d="M 542 762 L 658 762" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 524 571 C 527 568 531 566 535 566 L 569 566 C 573 566 577 568 580 571 L 600 594 C 601 596 601 597 600 598 L 580 621 C 577 625 573 626 569 626 L 535 626 C 531 626 527 625 524 621 L 504 598 C 504 597 504 596 504 594 L 524 571 Z" fill="#000000" stroke="#ffffff" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#FFFFFF" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="552" y="586">phys</text>
      <text x="552" y="600">button</text>
      <text x="552" y="614">press</text>
    </g>
    <path d="M 412 571 C 414 568 418 566 423 566 L 456 566 C 461 566 465 568 467 571 L 487 594 C 488 596 488 597 487 598 L 467 621 C 465 625 461 626 456 626 L 423 626 C 418 626 414 625 412 621 L 392 598 C 391 597 391 596 392 594 L 412 571 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="440" y="593">enter</text>
      <text x="440" y="607">timeout</text>
    </g>
    <path d="M 280 563 C 283 559 288 556 292 556 L 329 556 C 333 556 338 559 341 563 L 362 594 C 363 595 363 597 362 599 L 341 630 C 338 634 333 636 329 636 L 292 636 C 288 636 283 634 280 630 L 259 599 C 258 597 258 595 259 594 L 280 563 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="310" y="586">finger in</text>
      <text x="310" y="600">top</text>
      <text x="310" y="614">button != curr</text>
    </g>
    <path d="M 477 493 L 547 562" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 551 566 L 544 563 L 547 562 L 549 558 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 477 493 L 442 561" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 440 565 L 440 558 L 442 561 L 446 561 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 465 492 L 368 557" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 364 560 L 368 554 L 368 557 L 371 559 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 344 556 L 396 494" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 399 490 L 397 497 L 396 494 L 392 493 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 440 626 L 470 703" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 472 708 L 466 703 L 470 703 L 472 700 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 552 626 L 503 704" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 501 708 L 501 700 L 503 704 L 507 704 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 427 712 L 355 641" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 351 637 L 359 640 L 355 641 L 354 645 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 636 325 C 638 321 642 319 645 319 L 675 319 C 679 319 682 321 684 325 L 702 353 C 702 354 702 356 702 357 L 684 385 C 682 389 679 391 675 391 L 645 391 C 642 391 638 389 636 385 L 618 357 C 618 356 618 354 618 353 L 636 325 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="660" y="345">finger in</text>
      <text x="660" y="359">area or</text>
      <text x="660" y="373">bottom</text>
    </g>
    <path d="M 702 355 L 1048 355 Q 1058 355 1058 365 L 1058 386" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1058 391 L 1055 384 L 1058 386 L 1062 384 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 612 355 L 518 355 Q 508 355 508 365 L 508 392" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 617 355 L 610 359 L 612 355 L 610 352 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="66" y="715" width="194" height="94" rx="6" ry="6" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="163" y="752">TOP_TO_IGNORE</text>
      <text x="163" y="766">on-entry:</text>
      <text x="163" y="780">start leave timeout</text>
    </g>
    <path d="M 301 678 C 304 674 309 672 314 672 L 352 672 C 357 672 362 674 365 678 L 387 708 C 388 709 388 711 387 713 L 365 742 C 362 746 357 748 352 748 L 314 748 C 309 748 304 746 301 742 L 279 713 C 278 711 278 709 279 708 L 301 678 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="333" y="700">finger in</text>
      <text x="333" y="714">area or bottom</text>
    </g>
    <path d="M 304 769 C 307 765 311 762 316 762 L 352 762 C 357 762 361 765 364 769 L 385 799 C 386 801 386 803 385 805 L 364 835 C 361 840 357 842 352 842 L 316 842 C 311 842 307 840 304 835 L 283 805 C 282 803 282 801 283 799 L 304 769 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="334" y="785">finger in</text>
      <text x="334" y="799">top</text>
      <text x="334" y="813">button == curr</text>
    </g>
    <path d="M 278 710 L 262 756" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 260 761 L 259 753 L 262 756 L 266 756 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 279 797 L 260 762" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 282 801 L 275 797 L 279 797 L 281 793 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 412 762 L 391 716" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 388 711 L 395 716 L 391 716 L 388 719 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 409 767 L 386 802" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 411 763 L 410 771 L 409 767 L 405 767 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 238 712 L 282 642" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 285 637 L 284 645 L 282 642 L 278 641 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <rect x="98" y="391" width="130" height="100" rx="6" ry="6" fill="#ccffcc" stroke="#000000" stroke-width="2" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="163" y="431">IGNORE</text>
      <text x="163" y="445">on-entry:</text>
      <text x="163" y="459">curr =none</text>
    </g>
    <path d="M 135 541 C 138 538 142 536 146 536 L 180 536 C 184 536 188 538 191 541 L 211 564 C 211 566 211 567 211 568 L 191 591 C 188 595 184 596 180 596 L 146 596 C 142 596 138 595 135 591 L 115 568 C 114 567 114 566 115 564 L 135 541 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="163" y="563">leave</text>
      <text x="163" y="577">timeout</text>
    </g>
    <path d="M 163 536 L 163 497" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 163 492 L 166 499 L 163 497 L 159 499 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 163 715 L 163 603" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 163 597 L 166 604 L 163 603 L 159 604 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 98 441 L 18 441 Q 8 441 8 431 L 8 42 Q 8 32 18 32 L 732 32" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 737 32 L 730 36 L 732 32 L 730 29 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 66 762 L 18 762 Q 8 762 8 752 L 8 42 Q 8 32 18 32 L 732 32" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 737 32 L 730 36 L 732 32 L 730 29 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1813 477 L 1876 511 L 1813 546 L 1751 511 Z" fill="#ffffc0" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1813" y="515">touches in top?</text>
    </g>
    <path d="M 1876 511 L 1928 511 Q 1938 511 1938 518 L 1938 524" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1934 516 L 1938 525 L 1943 516" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1890" y="500" width="24" height="18" stroke-width="0"/>
      <text x="1890" y="509">yes</text>
    </g>
    <rect x="1898" y="526" width="80" height="30" rx="12" ry="12" fill="#ffffc0" stroke="#ff0000" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px">
      <text x="1938" y="545">is_top = 1</text>
    </g>
    <path d="M 1938 556 L 1938 562 Q 1938 568 1928 568 L 1815 568" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1823 564 L 1814 568 L 1823 573" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1813 546 L 1813 554 Q 1813 562 1813 564 L 1813 566" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <path d="M 1809 558 L 1813 567 L 1818 558" fill="none" stroke="#ff0000" stroke-miterlimit="10" pointer-events="none"/>
    <g fill="#000000" font-family="Helvetica" font-size="11px">
      <rect fill="#ffffff" stroke="none" x="1820" y="550" width="18" height="18" stroke-width="0"/>
      <text x="1820" y="559">no</text>
    </g>
  </g>
</svg>