** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 33 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 34 | **********************************************************************/ |
| 35 | void 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 |
nothing calls this directly
no test coverage detected