diff --git a/radio/src/thirdparty/libopenui/src/mainwindow.cpp b/radio/src/thirdparty/libopenui/src/mainwindow.cpp index 7cbe46111..16f9135d5 100644 --- a/radio/src/thirdparty/libopenui/src/mainwindow.cpp +++ b/radio/src/thirdparty/libopenui/src/mainwindow.cpp @@ -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; diff --git a/radio/src/thirdparty/libopenui/src/mainwindow.h b/radio/src/thirdparty/libopenui/src/mainwindow.h index fc47bdbc3..009c86454 100644 --- a/radio/src/thirdparty/libopenui/src/mainwindow.h +++ b/radio/src/thirdparty/libopenui/src/mainwindow.h @@ -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 };