Home | Trees | Index | Help |
---|
|
The input handler for pajammin. The input handler is a dispatcher which responds to keyboard and mouse input events by delegating them to registered callbacks.
To register a callback, create a listener for that callback, which specifies exactly which events you are interested in, and call itsstart()
method. E.g.:
>>> KeyPressListener(my_callback, key='x').start()
Listener
is an abstract base class; different subclasses
of Listener
are used to listen for different types of
events.
Listener
constructor using the
cbdata
parameter.) For different listeners, this event
object will define different data. The following list specifies which
fields the event object defines, for each listener type:
KeyPressListener
-- key
,
mod
KeyReleaseListener
-- key
,
mod
MousePressListener
-- button
,
pos
MouseReleaseListener
-- button
,
pos
MouseClickListener
-- button
,
pos
MouseDragListener
-- button
,
pos
, oldpos
MouseDragStartListener
-- button
,
pos
MouseDragStopListener
-- button
,
pos
Classes | |
---|---|
Listener |
An input dispatcher that listens for a specific type of input event, and when it occurs, calls a callback function. |
_KeyListener |
Base class for key-related events. |
_MouseButton |
The current state of a single mouse button. |
_MouseButtonListener |
Base class for mouse-related events |
_MouseClickDragListener |
Base class for mouse drag/click-related events |
Listeners | |
KeyListener |
An input listener that monitors one or more keys. |
KeyReleaseListener |
An event listener that reports key releases. |
KeyPressListener |
An event listener that reports key presses. |
MouseListener |
An input listener that monitors one or more mouse buttons.. |
MouseClickListener |
An event listener that reports mouse clicks. |
MouseDragStartListener |
An event listener that reports when mouse dragging starts. |
MouseReleaseListener |
An event listener that reports mouse releases. |
MouseDragStopListener |
An event listener that reports when mouse dragging stops. |
MouseDragListener |
An event listener that reports mouse dragging. |
MousePressListener |
An event listener that reports mouse presses. |
Function Summary | |
---|---|
handle_events()
| |
_clickdrag_mouse_press(event)
| |
_clickdrag_mouse_release(event)
| |
_drag_update()
|
Variable Summary | |
---|---|
int |
CLICK_DIST = 1 |
float |
CLICK_TIME = 0.10000000000000001 |
int |
HIGH_PRIORITY = 80 |
int |
LOW_PRIORITY = 20 |
LOW_PRIORITY, MEDIUM_PRIORITY, HIGH_PRIORITY : Standard priority values for listeners. | |
int |
MEDIUM_PRIORITY = 50 |
int |
priority = -2147483647 |
list |
_buttons = [<pajammin.input._MouseButton instance at 0x1...
|
tuple |
_EVENTS = (24, 6, 5, 3, 2)
|
bool |
_initialized = False
|
list |
_listeners = [<pajammin.input.MousePressListener instanc...
|
int |
_NUM_BUTTONS = 10 |
Function Details |
---|
handle_events() |
_clickdrag_mouse_press(event) |
_clickdrag_mouse_release(event) |
_drag_update() |
Variable Details |
---|
CLICK_DIST
|
CLICK_TIME
|
HIGH_PRIORITY
|
LOW_PRIORITY
|
LOW_PRIORITY, MEDIUM_PRIORITY, HIGH_PRIORITYStandard priority values for listeners. |
MEDIUM_PRIORITY
|
priority
|
_EVENTS
|
_initialized
|
_listeners
|
_NUM_BUTTONS
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:47 2005 | http://epydoc.sf.net |