Skip to content

Commit df8cb4d

Browse files
committed
wut?
1 parent a96d969 commit df8cb4d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

esp32/modules/dialogs.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,24 @@ def prompt_option(options, index=0, text = "Please select one of the following:"
162162
ugfx.poll()
163163

164164

165-
def do_interrupt(button):
165+
def pressed_a(pushed):
166166
global wait_for_interrupt, button_pushed
167167
wait_for_interrupt = False
168-
button_pushed = button
168+
button_pushed = 'A'
169169

170-
ugfx.input_attach(ugfx.BTN_A, do_interrupt('A'))
171-
ugfx.input_attach(ugfx.BTN_B, do_interrupt('B'))
172-
ugfx.input_attach(ugfx.BTN_START, do_interrupt('START'))
170+
def pressed_b(pushed):
171+
global wait_for_interrupt, button_pushed
172+
wait_for_interrupt = False
173+
button_pushed = 'B'
174+
175+
def pressed_start(pushed):
176+
global wait_for_interrupt, button_pushed
177+
wait_for_interrupt = False
178+
button_pushed = 'START'
179+
180+
ugfx.input_attach(ugfx.BTN_A, pressed_a)
181+
ugfx.input_attach(ugfx.BTN_B, pressed_b)
182+
ugfx.input_attach(ugfx.BTN_START, pressed_start)
173183

174184
class WaitingMessage:
175185
"""Shows a dialog with a certain message that can not be dismissed by the user"""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy