added a way to disable touch screen event handling
Needed for EdgeTX issue #185
This commit is contained in:
@@ -46,6 +46,9 @@ void MainWindow::checkEvents()
|
|||||||
touchPanelRead();
|
touchPanelRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!touchEnabled)
|
||||||
|
touchState.event = TE_NONE;
|
||||||
|
|
||||||
if (touchState.event == TE_DOWN) {
|
if (touchState.event == TE_DOWN) {
|
||||||
onTouchStart(touchState.x + scrollPositionX, touchState.y + scrollPositionY);
|
onTouchStart(touchState.x + scrollPositionX, touchState.y + scrollPositionY);
|
||||||
slidingWindow = nullptr;
|
slidingWindow = nullptr;
|
||||||
|
|||||||
+10
@@ -64,6 +64,13 @@ class MainWindow: public Window
|
|||||||
|
|
||||||
void checkEvents() override;
|
void checkEvents() override;
|
||||||
|
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
|
void setTouchEnabled(bool enable)
|
||||||
|
{
|
||||||
|
touchEnabled = enable;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void invalidate()
|
void invalidate()
|
||||||
{
|
{
|
||||||
invalidate({0, 0, rect.w, rect.h});
|
invalidate({0, 0, rect.w, rect.h});
|
||||||
@@ -85,4 +92,7 @@ class MainWindow: public Window
|
|||||||
static void emptyTrash();
|
static void emptyTrash();
|
||||||
rect_t invalidatedRect;
|
rect_t invalidatedRect;
|
||||||
const char * shutdown = nullptr;
|
const char * shutdown = nullptr;
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
|
bool touchEnabled = true;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user