** Function: InputHandler ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress **********************************************************************/
| 64 | ** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress |
| 65 | **********************************************************************/ |
| 66 | void InputHandler(void) { |
| 67 | static unsigned long tm = 0; |
| 68 | if (launcherMillis() - tm > 200 || LongPress) { |
| 69 | if (touch.touched()) { |
| 70 | auto t = touch.getPointScaled(); |
| 71 | auto t2 = touch.getPointRaw(); |
| 72 | launcherConsolePrintf("\nRAW: Touch Pressed on x=%d, y=%d, rot: %d", t2.x, t2.y, rotation); |
| 73 | launcherConsolePrintf("\nBEF: Touch Pressed on x=%d, y=%d, rot: %d", t.x, t.y, rotation); |
| 74 | if (rotation == 3) { |
| 75 | t.y = (tftHeight + 20) - t.y; |
| 76 | t.x = tftWidth - t.x; |
| 77 | } |
| 78 | if (rotation == 0) { |
| 79 | int tmp = t.x; |
| 80 | t.x = tftWidth - t.y; |
| 81 | t.y = tmp; |
| 82 | } |
| 83 | if (rotation == 2) { |
| 84 | int tmp = t.x; |
| 85 | t.x = t.y; |
| 86 | t.y = (tftHeight + 20) - tmp; |
| 87 | } |
| 88 | launcherConsolePrintf("\nAFT: Touch Pressed on x=%d, y=%d, rot: %d\n", t.x, t.y, rotation); |
| 89 | tm = launcherMillis(); |
| 90 | if (!wakeUpScreen()) AnyKeyPress = true; |
| 91 | else return; |
| 92 | |
| 93 | // Touch point global variable |
| 94 | touchPoint.x = t.x; |
| 95 | touchPoint.y = t.y; |
| 96 | touchPoint.pressed = true; |
| 97 | touchHeatMap(touchPoint); |
| 98 | } else touchPoint.pressed = false; |
| 99 | } |
| 100 | } |
nothing calls this directly
no test coverage detected