** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 60 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 61 | **********************************************************************/ |
| 62 | void InputHandler(void) { |
| 63 | static unsigned long tm = millis(); |
| 64 | if (!(millis() - tm > 200 || LongPress)) return; |
| 65 | |
| 66 | if (touch.touched()) { |
| 67 | auto t = touch.getPointScaled(); |
| 68 | t = touch.getPointScaled(); |
| 69 | if (bruceConfigPins.rotation == 3) { |
| 70 | t.y = (tftHeight + 20) - t.y; |
| 71 | t.x = tftWidth - t.x; |
| 72 | } |
| 73 | if (bruceConfigPins.rotation == 0) { |
| 74 | int tmp = t.x; |
| 75 | t.x = tftWidth - t.y; |
| 76 | t.y = tmp; |
| 77 | } |
| 78 | if (bruceConfigPins.rotation == 2) { |
| 79 | int tmp = t.x; |
| 80 | t.x = t.y; |
| 81 | t.y = (tftHeight + 20) - tmp; |
| 82 | } |
| 83 | tm = millis(); |
| 84 | if (!wakeUpScreen()) AnyKeyPress = true; |
| 85 | else return; |
| 86 | touchPoint.x = t.x; |
| 87 | touchPoint.y = t.y; |
| 88 | touchPoint.pressed = true; |
| 89 | touchHeatMap(touchPoint); |
| 90 | } else touchPoint.pressed = false; |
| 91 | } |
| 92 | |
| 93 | /********************************************************************* |
| 94 | ** Function: powerOff |
nothing calls this directly
no test coverage detected