From 97dbf64668f4fe6e4a72d629f2e387fce8e01a5d Mon Sep 17 00:00:00 2001 From: James Hodgson Date: Fri, 7 Oct 2022 14:42:20 +0100 Subject: [PATCH] #22 Add temp touch screen fix --- src/picamui/picamui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/picamui/picamui.py b/src/picamui/picamui.py index 08508b4..dc34c95 100644 --- a/src/picamui/picamui.py +++ b/src/picamui/picamui.py @@ -64,7 +64,8 @@ class PiCamUi: elif event.type == pygame.QUIT: events.append("pygameQuit") elif event.type == pygame.USEREVENT: - if event.user_type == pygame_gui.UI_BUTTON_PRESSED: + # Shoul be UI_BUTTON_PRESSED, but using on hover for now as having touch screen problems + if event.user_type == pygame_gui.UI_BUTTON_ON_HOVERED: for element in self.uiElements: if event.ui_element == element.get("element"): events.append("{}Pressed".format(element.get("name")))