added a way to disable touch screen event handling

Needed for EdgeTX issue #185
This commit is contained in:
gagarinlg
2021-10-24 22:32:03 +11:00
committed by Peter Feerick
parent 28f224e64a
commit 45db1393d6
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -46,6 +46,9 @@ void MainWindow::checkEvents()
touchPanelRead();
}
if(!touchEnabled)
touchState.event = TE_NONE;
if (touchState.event == TE_DOWN) {
onTouchStart(touchState.x + scrollPositionX, touchState.y + scrollPositionY);
slidingWindow = nullptr;
+10
View File
@@ -64,6 +64,13 @@ class MainWindow: public Window
void checkEvents() override;
#if defined(HARDWARE_TOUCH)
void setTouchEnabled(bool enable)
{
touchEnabled = enable;
}
#endif
void invalidate()
{
invalidate({0, 0, rect.w, rect.h});
@@ -85,4 +92,7 @@ class MainWindow: public Window
static void emptyTrash();
rect_t invalidatedRect;
const char * shutdown = nullptr;
#if defined(HARDWARE_TOUCH)
bool touchEnabled = true;
#endif
};