MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / touchHeatMap

Function touchHeatMap

src/utils.cpp:7–55  ·  view source on GitHub ↗

** Function: touchHeatMap ** Touchscreen Mapping, include this function after reading the touchPoint **********************************************************************/

Source from the content-addressed store, hash-verified

5** Touchscreen Mapping, include this function after reading the touchPoint
6**********************************************************************/
7void touchHeatMap(struct LTouchPoint t) {
8 int third_x = tftWidth / 3;
9 int third_y = tftHeight / 3;
10
11#if 1 // defined(DONT_USE_INPUT_TASK)
12 if (t.x > third_x * 0 && t.x < third_x * 1 && t.y > tftHeight - 30) PrevPress = true;
13 if (t.x > third_x * 1 && t.x < third_x * 2 && t.y > tftHeight - 30) SelPress = true;
14 if (t.x > third_x * 2 && t.x < third_x * 3 && t.y > tftHeight - 30) NextPress = true;
15 if (t.x > third_x * 0 && t.x < third_x * 1 && t.y < 50) EscPress = true;
16
17 /*
18 Touch area Map
19 ________________________________ 0
20 |_Esc_|_______________________|
21 |_____________________________|
22 |_____________________________|
23 |_____________________________|
24 |_____________________________|
25 |_____________________________|
26 |__Prev___|___Sel___|__Next___| 30 pixel touch area where the touchFooter is drawn
27 0 L third_x | |
28 Lthird_x*2|
29 Lthird_x*3
30 */
31
32#else
33 if (t.x > third_x * 0 && t.x < third_x * 1 && t.y > third_y) PrevPress = true;
34 if (t.x > third_x * 1 && t.x < third_x * 2 && ((t.y > third_y && t.y < third_y * 2) || t.y > tftHeight))
35 SelPress = true;
36 if (t.x > third_x * 2 && t.x < third_x * 3) NextPress = true;
37 if (t.x > third_x * 0 && t.x < third_x * 1 && t.y < third_y) EscPress = true;
38 if (t.x > third_x * 1 && t.x < third_x * 2 && t.y < third_y) UpPress = true;
39 if (t.x > third_x * 1 && t.x < third_x * 2 && t.y > third_y * 2 && t.y < third_y * 3) DownPress = true;
40 /*
41 Touch area Map
42 ________________________________ 0
43 | Esc | UP | |
44 |_________|_________| |_> third_y
45 | | Sel | |
46 | |_________| Next |_> third_y*2
47 | Prev | Down | |
48 |_________|_________|_________|_> third_y*3
49 |__Prev___|___Sel___|__Next___| 20 pixel touch area where the touchFooter is drawn
50 0 L third_x | |
51 Lthird_x*2|
52 Lthird_x*3
53 */
54#endif
55}

Callers 15

InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected