| |
- EventHandlerMixin(object)
-
- InteractiveContext
class InteractiveContext(EventHandlerMixin) |
|
Context mix-in providing event-handling managers
Supports:
keyboard, keypress -- provided by the keyboardevents module
mousebutton, mousemove -- provided by the mouseevents module
timers -- provided by the timeeventgeneratormanager module
Attributes:
EventManagerClasses -- list of standard event-managers to be
initialised for the context
TimeManagerClass -- class for use in supporting the Timer
functionality |
|
- Method resolution order:
- InteractiveContext
- EventHandlerMixin
- object
Data and other attributes defined here:
- EventManagerClasses = [('keyboard', <class 'OpenGLContext.events.keyboardevents.KeyboardEventManager'>), ('keypress', <class 'OpenGLContext.events.keyboardevents.KeypressEventManager'>), ('mousebutton', <class 'OpenGLContext.events.mouseevents.MouseButtonEventManager'>), ('mousemove', <class 'OpenGLContext.events.mouseevents.MouseMoveEventManager'>), ('mousein', <class 'OpenGLContext.events.mouseevents.MouseInEventManager'>), ('mouseout', <class 'OpenGLContext.events.mouseevents.MouseOutEventManager'>)]
- TimeManagerClass = <class 'OpenGLContext.events.timeeventgeneratormanager.TimeEventGeneratorManager'>
- TimeEventGenerator EventManager object
This object conforms to the EventManager interface,
although it doesn't actually inherit from that class.
It provides support for the InternalTime generators
on which the Timer object is based.
Methods inherited from EventHandlerMixin:
- DoEventCascade(self)
- Do pre-rendering event cascade
Returns the total number of events generated by
timesensors and/or processed from the event cascade queue
- ProcessEvent(self, event)
- Primary dispatch point for events.
ProcessEvent uses the event's type attribute to determine the
appropriate manager for processing, then dispatches to that manager's
ProcessEvent method.
- addEventHandler(self, eventType, *arguments, **namedarguments)
- Add a new event handler function for the given event type
This is the primary client API for dealing with the event system.
Each event class will define a particular set of data values
required to form the routing key for the event. Each event handler
class will define a registerCallback function which converts
its arguments into a matching key.
This function merely determines the appropriate handler then
dispatches to the handler's registerCallback method (without the
eventType argument).
See: mouseevents, keyboardevents
- addEventManager(self, eventType, manager=None)
- Add an event manager to the internal table of managers.
The return value is the previous manager or None if there was
no previous manager.
- captureEvents(self, eventType, manager=None)
- Temporarily capture events of a particular type.
This temporarily replaces a particular manager within the
dispatch set with provided manager. This will normally be
used to create "modal" interfaces such as active drag
functions (where the interface is in a different "interaction
mode", so that actions have different meaning than in the
"default mode").
Passing None as the manager will restore the previous manager
to functioning.
Note: this function does not perform a "system capture"
of input (that is, mouse movements are only available if they
occur over the context's window and that window has focus).
Note: for capturing mouse input, you will likely want to
capture both movement and button events, it should be possible
to define a single handler to deal with both event types,
and pass that handler twice, once for each event type.
- getEventManager(self, eventType)
- Retrieve an event manager from the internal table of managers
Returns the appropriate manager, or None if there was no
manager registered for the given event type.
- getTimeManager(self)
- Get the time-event manager for this context
- initializeEventManagers(self)
- Initialize the event manager classes for this context.
This implementation iterates over self.EventManagerClasses
(a list of (eventType, managerClass) values) and calls
addEventManager for each item.
Data descriptors inherited from EventHandlerMixin:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |