@@ -64,8 +64,8 @@ def __init__(
6464 name : str | None = None ,
6565 accept_keyboard_keys : bool | Iterable = True ,
6666 accept_mouse_events : bool | Iterable = True ,
67- prevent_dispatch : Iterable | None = None ,
68- prevent_dispatch_view : Iterable | None = None ,
67+ prevent_dispatch : Iterable | bool | None = None ,
68+ prevent_dispatch_view : Iterable | bool | None = None ,
6969 local_mouse_coordinates : bool = False ,
7070 enabled : bool = True ,
7171 modal : bool = False ,
@@ -96,10 +96,14 @@ def __init__(
9696 self .accept_mouse_events : bool | Iterable = accept_mouse_events
9797 """Arcade mouse events to accept."""
9898
99+ if isinstance (prevent_dispatch , bool ):
100+ prevent_dispatch = {prevent_dispatch }
99101 self .prevent_dispatch : Iterable = {True } if prevent_dispatch is None else prevent_dispatch
100102 assert isinstance (self .prevent_dispatch , Iterable )
101103 """prevents events to propagate"""
102104
105+ if isinstance (prevent_dispatch_view , bool ):
106+ prevent_dispatch_view = {prevent_dispatch_view }
103107 self .prevent_dispatch_view : Iterable = (
104108 {True } if prevent_dispatch_view is None else prevent_dispatch_view
105109 )
0 commit comments