MCPcopy Create free account
hub / github.com/BruceDevices/firmware / touchHeatMap

Function touchHeatMap

src/core/utils.cpp:201–226  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

199** Touchscreen Mapping, include this function after reading the touchPoint
200**********************************************************************/
201void touchHeatMap(struct TouchPoint t) {
202 int third_x = tftWidth / 3;
203 int third_y = tftHeight / 3;
204
205 if (t.x > third_x * 0 && t.x < third_x * 1 && t.y > third_y) PrevPress = true;
206 if (t.x > third_x * 1 && t.x < third_x * 2 && ((t.y > third_y && t.y < third_y * 2) || t.y > tftHeight))
207 SelPress = true;
208 if (t.x > third_x * 2 && t.x < third_x * 3) NextPress = true;
209 if (t.x > third_x * 0 && t.x < third_x * 1 && t.y < third_y) EscPress = true;
210 if (t.x > third_x * 1 && t.x < third_x * 2 && t.y < third_y) UpPress = true;
211 if (t.x > third_x * 1 && t.x < third_x * 2 && t.y > third_y * 2 && t.y < third_y * 3) DownPress = true;
212 /*
213 Touch area Map
214 ________________________________ 0
215 | Esc | UP | |
216 |_________|_________| |_> third_y
217 | | Sel | |
218 | |_________| Next |_> third_y*2
219 | Prev | Down | |
220 |_________|_________|_________|_> third_y*3
221 |__Prev___|___Sel___|__Next___| 20 pixel touch area where the touchFooter is drawn
222 0 L third_x | |
223 Lthird_x*2|
224 Lthird_x*3
225 */
226}
227
228#endif
229

Callers 15

InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
InputHandlerFunction · 0.85
interface.cppFile · 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