ipygame.event
pygame-compatible event module.
Event Objects
Section titled “Event Objects”class Event()Represents a single event, compatible with pygame.event.Event.
__init__
Section titled “__init__”def __init__(event_type: int, attributes: dict | None = None, **kwargs)@propertydef dict() -> dictdef pump() -> NoneInternal processing — no-op in ipygame (events arrive via callbacks).
def get(eventtype=None, pump: bool = True, exclude=None) -> list[Event]Get and remove events from the queue.
eventtype can be a single type int, a sequence of types, or
None (all events).
def poll() -> EventGet a single event from the queue (or NOEVENT).
def wait(timeout: int = 0) -> EventWait for an event. In Jupyter this just polls (blocking not advisable).
def peek(eventtype=None) -> boolReturn True if there are events of the given type in the queue.
def clear(eventtype=None) -> NoneRemove events from the queue.
def post(event: Event) -> boolPlace an event on the queue.
event_name
Section titled “event_name”def event_name(event_type: int) -> strReturn a human-readable name for event_type.
set_blocked
Section titled “set_blocked”def set_blocked(event_type) -> Noneset_allowed
Section titled “set_allowed”def set_allowed(event_type) -> Noneget_blocked
Section titled “get_blocked”def get_blocked(event_type: int) -> boolset_grab
Section titled “set_grab”def set_grab(grab: bool) -> Noneget_grab
Section titled “get_grab”def get_grab() -> boolcustom_type
Section titled “custom_type”def custom_type() -> intAllocate and return a unique event type id.