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