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

Function InputHandler

boards/elecrow/interface.cpp:62–91  ·  view source on GitHub ↗

** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/

Source from the content-addressed store, hash-verified

60** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
61**********************************************************************/
62void InputHandler(void) {
63 static unsigned long tm = millis();
64 if (!(millis() - tm > 200 || LongPress)) return;
65
66 if (touch.touched()) {
67 auto t = touch.getPointScaled();
68 t = touch.getPointScaled();
69 if (bruceConfigPins.rotation == 3) {
70 t.y = (tftHeight + 20) - t.y;
71 t.x = tftWidth - t.x;
72 }
73 if (bruceConfigPins.rotation == 0) {
74 int tmp = t.x;
75 t.x = tftWidth - t.y;
76 t.y = tmp;
77 }
78 if (bruceConfigPins.rotation == 2) {
79 int tmp = t.x;
80 t.x = t.y;
81 t.y = (tftHeight + 20) - tmp;
82 }
83 tm = millis();
84 if (!wakeUpScreen()) AnyKeyPress = true;
85 else return;
86 touchPoint.x = t.x;
87 touchPoint.y = t.y;
88 touchPoint.pressed = true;
89 touchHeatMap(touchPoint);
90 } else touchPoint.pressed = false;
91}
92
93/*********************************************************************
94** Function: powerOff

Callers

nothing calls this directly

Calls 5

millisFunction · 0.85
wakeUpScreenFunction · 0.85
touchHeatMapFunction · 0.85
touchedMethod · 0.45
getPointScaledMethod · 0.45

Tested by

no test coverage detected