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

Function InputHandler

boards/m5stack-cores3/interface.cpp:35–53  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

33** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
34**********************************************************************/
35void InputHandler(void) {
36 static long tm = launcherMillis();
37 if (launcherMillis() - tm > 200 || LongPress) {
38 M5.update();
39 auto t = M5.Touch.getDetail();
40 if (t.isPressed() || t.isHolding()) {
41 tm = launcherMillis();
42
43 if (!wakeUpScreen()) AnyKeyPress = true;
44 else return;
45
46 // Touch point global variable
47 touchPoint.x = t.x;
48 touchPoint.y = t.y;
49 touchPoint.pressed = true;
50 touchHeatMap(touchPoint);
51 } else touchPoint.pressed = false;
52 }
53}
54
55/*********************************************************************
56** Function: powerOff

Callers

nothing calls this directly

Calls 5

launcherMillisFunction · 0.85
wakeUpScreenFunction · 0.85
touchHeatMapFunction · 0.85
isPressedMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected