(self, event_type, *args)
return False
Dispatch a single event to the attached handlers.
        
        The event is propagated to all handlers from from the top of the stack
        until one returns `EVENT_HANDLED`.  This method should be used only by
        `EventDispatcher` implementors; applications should call
        the ``dispatch_events`` method.

        Since pyglet 1.2, the method returns `EVENT_HANDLED` if an event
        handler returned `EVENT_HANDLED` or `EVENT_UNHANDLED` if all events
        returned `EVENT_UNHANDLED`.  If no matching event handlers are in the
        stack, ``False`` is returned.

        :Parameters:
            `event_type` : str
                Name of the event.
            `args` : sequence
                Arguments to pass to the event handler.

        :rtype: bool or None
        :return: (Since pyglet 1.2) `EVENT_HANDLED` if an event handler 
            returned `EVENT_HANDLED`; `EVENT_UNHANDLED` if one or more event
            handlers were invoked but returned only `EVENT_UNHANDLED`;
            otherwise ``False``.  In pyglet 1.1 and earler, the return value
            is always ``None``.
Dispatch a single event to the attached handlers.
        
        The event is propagated to all handlers from from the top of the stack
        until one returns `EVENT_HANDLED`.  This method should be used only by
        `EventDispatcher` implementors; applications should call
        the ``dispatch_events`` method.
Dispatch a single event to the attached handlers . The event is propagated to all handlers from from the top of the stack until one returns EVENT_HANDLED . This method should be used only by EventDispatcher implementors ; applications should call the dispatch_events method .
def dispatch_event(self, event_type, *args):
        '''Dispatch a single event to the attached handlers.
        
        The event is propagated to all handlers from from the top of the stack
        until one returns `EVENT_HANDLED`.  This method should be used only by
        `EventDispatcher` implementors; applications should call
        the ``dispatch_events`` method.

        Since pyglet 1.2, the method returns `EVENT_HANDLED` if an event
        handler returned `EVENT_HANDLED` or `EVENT_UNHANDLED` if all events
        returned `EVENT_UNHANDLED`.  If no matching event handlers are in the
        stack, ``False`` is returned.

        :Parameters:
            `event_type` : str
                Name of the event.
            `args` : sequence
                Arguments to pass to the event handler.

        :rtype: bool or None
        :return: (Since pyglet 1.2) `EVENT_HANDLED` if an event handler 
            returned `EVENT_HANDLED`; `EVENT_UNHANDLED` if one or more event
            handlers were invoked but returned only `EVENT_UNHANDLED`;
            otherwise ``False``.  In pyglet 1.1 and earler, the return value
            is always ``None``.

        '''
        assert event_type in self.event_types, "%r not found in %r.event_types == %r" % (event_type, self, self.event_types)

        invoked = False

        # Search handler stack for matching event handlers
        for frame in list(self._event_stack):
            handler = frame.get(event_type, None)
            if handler:
                try:
                    invoked = True
                    if handler(*args):
                        return EVENT_HANDLED
                except TypeError:
                    self._raise_dispatch_exception(event_type, args, handler)


        # Check instance for an event handler
        if hasattr(self, event_type):
            try:
                invoked = True
                if getattr(self, event_type)(*args):
                    return EVENT_HANDLED
            except TypeError:
                self._raise_dispatch_exception(
                    event_type, args, getattr(self, event_type))

        if invoked:
            return EVENT_UNHANDLED

        return False
def dispatch_event ( self , event_type , * args ) : assert event_type in self . event_types , "%r not found in %r.event_types == %r" % ( event_type , self , self . event_types ) invoked = False # Search handler stack for matching event handlers for frame in list ( self . _event_stack ) : handler = frame . get ( event_type , None ) if handler : try : invoked = True if handler ( * args ) : return EVENT_HANDLED except TypeError : self . _raise_dispatch_exception ( event_type , args , handler ) # Check instance for an event handler if hasattr ( self , event_type ) : try : invoked = True if getattr ( self , event_type ) ( * args ) : return EVENT_HANDLED except TypeError : self . _raise_dispatch_exception ( event_type , args , getattr ( self , event_type ) ) if invoked : return EVENT_UNHANDLED return False