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

Function InputHandler

boards/m5stack-paper-s3/interface.cpp:45–64  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected