Module events
source code
PyChan event handling (internal).
Users shouldn't need to use this module directly. widgets.Widget.capture and widgets.Widget.mapEvents provide a convenient API
to capture events.
Nevertheless to understand how its supposed to work take a look at
EventMapper and EventListenerBase
Event callbacks
You can either write callbacks yourself or use tools.callBackWithArguments or tools.attrSetCallback to generate suitable
callbacks.
Here's an example callback:
def dumpEventInfo(event=0,widget=0):
print widget, " received the event ", event
Note the signature - event and widget
are keyword arguments passed to the callback. If doesn't accept
either event or widget as argument, these
are not passed.
This way a simple function which ignores event or
widget can be used, while they are available if
needed.
Currently only one callback can be set per event. In case you
don't want to write your own callback that dispatches to different
callbacks you can use tools.chainCallbacks.
Available Events
|
|
|
|
|
splitEventDescriptor(name)
Utility function to split "widgetName/eventName"
descriptions into tuples. |
source code
|
|
EVENTS
- Value:
["mouseEntered", "mouseExited", "mousePressed", "mouseReleased", "mous
eClicked", "mouseMoved", "mouseWheelMovedUp", "mouseWheelMovedDown", "
mouseDragged", "action", "keyPressed", "keyReleased",]
|
|
CALLBACK_NONE_MESSAGE
- Value:
"""\
You passed None as parameter to %s.capture, which would normally remov
e a mapped event.
But there was no event mapped. Did you accidently call a function inst
ead of passing it?
"""
|
|