Control systems for binding controls to game logic
System that maps subclass-defined action methods to keys.
Keys may be mapped in the subclass definition using decorators defined here as class methods or at runtime using the bind_key_* instance methods.
See an example implementation in the tutorial.
Bind a method to a key at runtime to be invoked when the key is held down, this replaces any existing key hold binding for this key. To unbind the key entirely, pass None for method.
Bind a method to a key at runtime to be invoked when the key is initially pressed, this replaces any existing key hold binding for this key. To unbind the key entirely, pass None for method.
Bind a method to a key at runtime to be invoked when the key is releaseed, this replaces any existing key hold binding for this key. To unbind the key entirely, pass None for method.
Decorator to bind a method to be executed where a key is held down
Decorator to bind a method to be executed where a key is initially depressed
Decorator to bind a method to be executed where a key is released
Handle pyglet key press. Invoke key press methods and activate key hold functions
Handle pyglet key release. Invoke key release methods and deactivate key hold functions
The MODIFIER_MASK allows you to filter out modifier keys that should be ignored by the application. By default, numlock and scrolllock are ignored.
grease.World object this system is bound to