10000 Ignore inputs in FocusGroup if no widget is focused · pythonarcade/arcade@7b55f01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b55f01

Browse files
committed
Ignore inputs in FocusGroup if no widget is focused
1 parent 8df726c commit 7b55f01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arcade/gui/experimental/focus.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def on_event(self, event: UIEvent) -> bool | None:
8787
self.set_focus()
8888
return EVENT_HANDLED
8989

90-
if isinstance(event, UIKeyPre 64EB ssEvent):
90+
if self.focused_widget is None:
91+
# no focused widget, ignore events
92+
return EVENT_UNHANDLED
93+
94+
elif isinstance(event, UIKeyPressEvent):
9195
if event.symbol == arcade.key.TAB:
9296
if event.modifiers & arcade.key.MOD_SHIFT:
9397
self.focus_previous()

0 commit comments

Comments
 (0)
0