Home | Trees | Index | Help |
---|
Package pygsear :: Module Event :: Class Repeat_KEY_Event |
|
object
--+ |Sprite
--+ |Event
--+ |KEY_Event
--+ | Repeat_KEY_Event
KEY_Event which will auto-repeat after a delay.
if nokey
parameter is passed in, this Event will listen
for all keyboard keypress events. Since the only thing I am using this
for right now is for text input, I made the behavior somewhat like a
command line interface. Specifically: shift, alt, and ctrl are treated
specially and will not repeat. I considered keeping track of a
dict
of active keypress, but it seemed like much work for
little gain. It should not be too difficult though if someone needs that
functionality.
Method Summary | |
---|---|
Initialize a keyboard event that will auto-repeat when the key is held. | |
Do nothing, so we can handle the on_hold a different way here. | |
Do nothing, so we can handle the on_hold a different way here. | |
Call the callback at the requested interval. | |
Start counting down the delay time until auto-repeat kicks in. | |
Reset the counters. | |
Inherited from KEY_Event | |
Perform the callback, if the event is enabled, and the key pressed is the right key. | |
| |
Inherited from Event | |
Add this Event to an EventGroup . | |
Do not allow callbacks to go through. | |
Allow callbacks to go through. | |
Do nothing. | |
Inherited from Sprite | |
| |
| |
alive() -> bool check to see if the sprite is in any groups | |
groups() -> list of groups list used sprite containers | |
kill() remove this sprite from all groups | |
remove(group or list of groups, ...) remove a sprite from container | |
| |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T |
Method Details |
---|
__init__(self,
key=None,
on_press=None,
on_hold=None,
on_release=None,
delay=400,
period=50,
**kwargs)
Initialize a keyboard event that will auto-repeat when the key is
held.
|
press(self, ev)Do nothing, so we can handle the on_hold a different way here.
|
release(self, ev)Do nothing, so we can handle the on_hold a different way here.
|
rhold(self, ev)Call the callback at the requested interval. |
rpress(self, ev)Start counting down the delay time until auto-repeat kicks in. |
rrelease(self, ev)Reset the counters. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sat Dec 9 14:11:20 2006 | http://epydoc.sf.net |