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

Function InputHandler

boards/m5stack-core2/interface.cpp:37–55  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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