| |
- EventHandlerMixin(object)
-
- EventHandlerMixin
- object
-
- wxXEvent
-
- wxKeyboardEvent(wxXEvent, KeyboardEvent)
- wxKeypressEvent(wxXEvent, KeypressEvent)
- wxMouseButtonEvent(wxXEvent, MouseButtonEvent)
- wxMouseMoveEvent(wxXEvent, MouseMoveEvent)
class EventHandlerMixin(EventHandlerMixin) |
|
wxPython-specific event handler mix-in
Basically provides translation from wxPython events
to their OpenGLContext-specific equivalents (the
concrete versions of which are also defined in this
module). |
|
- Method resolution order:
- EventHandlerMixin
- EventHandlerMixin
- object
Methods defined here:
- wxOnCharacter(self, event)
- Convert character (non-control) press to context event
- wxOnKeyDown(self, event)
- Convert a key-press to a context-style event
- wxOnKeyUp(self, event)
- Convert a key-release to a context-style event
- wxOnMouseButton(self, event)
- Convert mouse-button event to context event
- wxOnMouseMove(self, event)
- Convert mouse-movement event to context event
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)
Data and other attributes inherited from EventHandlerMixin:
- EventManagerClasses = []
- TimeManagerClass = None
|
class wxKeyboardEvent(wxXEvent, KeyboardEvent) |
|
wxPython-specific keyboard event |
|
- Method resolution order:
- wxKeyboardEvent
- wxXEvent
- KeyboardEvent
- Event
- object
Methods defined here:
- __init__(self, context, wxEventObject, state=0)
Data descriptors inherited from wxXEvent:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from KeyboardEvent:
- getKey(self)
- Get the event key used to lookup a handler for this event
Data and other attributes inherited from KeyboardEvent:
- name = ''
- side = 0
- state = 0
- type = 'keyboard'
Methods inherited from Event:
- getModifiers(self)
- Retrieve a tuple of the active modifier keys
Format is three Boolean values, (shift, control, alt)
- visited(self, key, value=None)
- Check for or register visitation of the given key
key -- an opaque hashable value, normally the node and
field/event as a tuple.
value -- if provided, sets the current value, otherwise
signals that the current value should be returned
return value: previous key value (possibly None)
Data and other attributes inherited from Event:
- context = None
- modifiers = (0, 0, 0)
- renderingPass = None
|
class wxKeypressEvent(wxXEvent, KeypressEvent) |
|
wxPython-specific key-press event |
|
- Method resolution order:
- wxKeypressEvent
- wxXEvent
- KeypressEvent
- Event
- object
Methods defined here:
- __init__(self, context, wxEventObject)
Data descriptors inherited from wxXEvent:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from KeypressEvent:
- getKey(self)
- Get the event key used to lookup a handler for this event
Data and other attributes inherited from KeypressEvent:
- name = ''
- repeating = 0
- side = 0
- type = 'keypress'
Methods inherited from Event:
- getModifiers(self)
- Retrieve a tuple of the active modifier keys
Format is three Boolean values, (shift, control, alt)
- visited(self, key, value=None)
- Check for or register visitation of the given key
key -- an opaque hashable value, normally the node and
field/event as a tuple.
value -- if provided, sets the current value, otherwise
signals that the current value should be returned
return value: previous key value (possibly None)
Data and other attributes inherited from Event:
- context = None
- modifiers = (0, 0, 0)
- renderingPass = None
|
class wxMouseButtonEvent(wxXEvent, MouseButtonEvent) |
|
wxPython-specific mouse button event |
|
- Method resolution order:
- wxMouseButtonEvent
- wxXEvent
- MouseButtonEvent
- MouseEvent
- Event
- object
Methods defined here:
- __init__(self, context, wxEventObject)
Data and other attributes defined here:
- BUTTON_MAPPING = ((0, 1), (1, 3), (2, 2))
Data descriptors inherited from wxXEvent:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from MouseButtonEvent:
- getKey(self)
- Get the event key used to lookup a handler for this event
Data and other attributes inherited from MouseButtonEvent:
- button = -1
- state = 0
- type = 'mousebutton'
Methods inherited from MouseEvent:
- getNameStack(self)
- Get the name-stack as reported by the rendering pass.
- getObjectPaths(self)
- Get the object-path object (None if not set)
- getPickPoint(self)
- Get the 2D picking point in OpenGL coordinates
Note that OpenGL coordinates are counted from the bottom left
corner of the window, in contrast to most windowing libraries
which use the upper left corner as the origin.
- project(self, worldCoordinate=None)
- Get the screen coordinates for the event w/out
the pick-point requires that worldCoordinate and
rendering pass be available or that the
viewCoordinate field already be available.
- setNameStack(self, stack)
- Set the name-stack. Called by the select render mode
- setObjectPaths(self, paths)
- Set the object-path sets
- unproject(self, viewCoordinate=None)
- Get the world coordinates for viewCoordinate for the event
viewCoordinate -- coordinate to project, if omitted, the
first "hit" entry in the name-stack will be used. Otherwise
should be a three-item array/tuple. The z component of
this tuple is interpreted acording to type. If it's an
integer or long, it's consider a raw OpenGL depth-buffer
value as returned in the name-stack, and is converted to
a floating-point depth value. If it's already a floating-
point value, it's left as-is.
Data and other attributes inherited from MouseEvent:
- atTarget = 0
- currentNode = None
- currentPath = ()
- modelViewMatrix = None
- nameStack = ()
- objectPaths = None
- pickPoint = ()
- processMorePaths = 0
- projectionMatrix = None
- stopPropagation = 0
- viewCoordinate = ()
- viewport = None
- worldCoordinate = ()
Methods inherited from Event:
- getModifiers(self)
- Retrieve a tuple of the active modifier keys
Format is three Boolean values, (shift, control, alt)
- visited(self, key, value=None)
- Check for or register visitation of the given key
key -- an opaque hashable value, normally the node and
field/event as a tuple.
value -- if provided, sets the current value, otherwise
signals that the current value should be returned
return value: previous key value (possibly None)
Data and other attributes inherited from Event:
- context = None
- modifiers = (0, 0, 0)
- renderingPass = None
|
class wxMouseMoveEvent(wxXEvent, MouseMoveEvent) |
|
wxPython-specific mouse movement event |
|
- Method resolution order:
- wxMouseMoveEvent
- wxXEvent
- MouseMoveEvent
- MouseEvent
- Event
- object
Methods defined here:
- __init__(self, context, wxEventObject)
Data descriptors inherited from wxXEvent:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from MouseMoveEvent:
- getButtons(self)
- Return the active buttons as a tuple of integers.
- getKey(self)
- Get the event key used to lookup a handler for this event
Data and other attributes inherited from MouseMoveEvent:
- buttons = ()
- dragStart = ()
- type = 'mousemove'
Methods inherited from MouseEvent:
- getNameStack(self)
- Get the name-stack as reported by the rendering pass.
- getObjectPaths(self)
- Get the object-path object (None if not set)
- getPickPoint(self)
- Get the 2D picking point in OpenGL coordinates
Note that OpenGL coordinates are counted from the bottom left
corner of the window, in contrast to most windowing libraries
which use the upper left corner as the origin.
- project(self, worldCoordinate=None)
- Get the screen coordinates for the event w/out
the pick-point requires that worldCoordinate and
rendering pass be available or that the
viewCoordinate field already be available.
- setNameStack(self, stack)
- Set the name-stack. Called by the select render mode
- setObjectPaths(self, paths)
- Set the object-path sets
- unproject(self, viewCoordinate=None)
- Get the world coordinates for viewCoordinate for the event
viewCoordinate -- coordinate to project, if omitted, the
first "hit" entry in the name-stack will be used. Otherwise
should be a three-item array/tuple. The z component of
this tuple is interpreted acording to type. If it's an
integer or long, it's consider a raw OpenGL depth-buffer
value as returned in the name-stack, and is converted to
a floating-point depth value. If it's already a floating-
point value, it's left as-is.
Data and other attributes inherited from MouseEvent:
- atTarget = 0
- currentNode = None
- currentPath = ()
- modelViewMatrix = None
- nameStack = ()
- objectPaths = None
- pickPoint = ()
- processMorePaths = 0
- projectionMatrix = None
- stopPropagation = 0
- viewCoordinate = ()
- viewport = None
- worldCoordinate = ()
Methods inherited from Event:
- getModifiers(self)
- Retrieve a tuple of the active modifier keys
Format is three Boolean values, (shift, control, alt)
- visited(self, key, value=None)
- Check for or register visitation of the given key
key -- an opaque hashable value, normally the node and
field/event as a tuple.
value -- if provided, sets the current value, otherwise
signals that the current value should be returned
return value: previous key value (possibly None)
Data and other attributes inherited from Event:
- context = None
- modifiers = (0, 0, 0)
- renderingPass = None
|
class wxXEvent(object) |
|
Base-class for all wxPython-specific event classes
Provides method for determining the modifier set from
wxPython event objects |
|
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |