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

Function InputHandler

boards/m5stack-tab5/interface.cpp:47–66  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

45** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
46**********************************************************************/
47void InputHandler(void) {
48 static long tm = launcherMillis();
49 if (launcherMillis() - tm > 200 || LongPress) {
50 M5.update();
51 auto t = M5.Touch.getDetail();
52 if (t.isPressed() || t.isHolding()) {
53 // launcherConsolePrintf("x1=%d, y1=%d, ", t.x, t.y);
54 tm = launcherMillis();
55 if (!wakeUpScreen()) AnyKeyPress = true;
56 else return;
57 // launcherConsolePrintf("x2=%d, y2=%d, rot=%d\n", t.x, t.y, rotation);
58
59 // Touch point global variable
60 touchPoint.x = t.x;
61 touchPoint.y = t.y;
62 touchPoint.pressed = true;
63 touchHeatMap(touchPoint);
64 } else touchPoint.pressed = false;
65 }
66}
67/*********************************************************************
68** Function: powerOff
69** location: mykeyboard.cpp

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