diff --git a/arcade/sections.py b/arcade/sections.py index a9d876304..eabff304b 100644 --- a/arcade/sections.py +++ b/arcade/sections.py @@ -64,8 +64,8 @@ def __init__( name: str | None = None, accept_keyboard_keys: bool | Iterable = True, accept_mouse_events: bool | Iterable = True, - prevent_dispatch: Iterable | None = None, - prevent_dispatch_view: Iterable | None = None, + prevent_dispatch: Iterable | bool | None = None, + prevent_dispatch_view: Iterable | bool | None = None, local_mouse_coordinates: bool = False, enabled: bool = True, modal: bool = False, @@ -96,10 +96,14 @@ def __init__( self.accept_mouse_events: bool | Iterable = accept_mouse_events """Arcade mouse events to accept.""" + if isinstance(prevent_dispatch, bool): + prevent_dispatch = {prevent_dispatch} self.prevent_dispatch: Iterable = {True} if prevent_dispatch is None else prevent_dispatch assert isinstance(self.prevent_dispatch, Iterable) """prevents events to propagate""" + if isinstance(prevent_dispatch_view, bool): + prevent_dispatch_view = {prevent_dispatch_view} self.prevent_dispatch_view: Iterable = ( {True} if prevent_dispatch_view is None else prevent_dispatch_view )