input
— Handling input from keyboard, mouse and controllers¶
InputManager
reference¶
-
class
input.
InputManager
¶
Input manager object can be accessed via Scene.input property. It has three main features:
Gives you access to specialized managers:
MouseManager
,KeyboardManager
,ControllerManager
andSystemManager
- they offer methods to actively check for input from your code. For instance, you can ask theKeyboardManager
if given key is pressed or released.Gives you access to a list of events which ocurred during the frame. This is achieved by calling the
InputManager.events()
method. Check out theEvent
documentation for a list of all available events that kaaengine detects.Allows you to subscribe to specific types of events by registering your own callback function. This is done using
InputManager.register_callback()
function.
And a number of other minor features.
Instance Properties:
-
InputManager.
keyboard
¶ A get accessor returning
KeyboardManager
object which exposes methods to check for keyboard input. See theKeyboardManager
documentation for a full list of available methods.
-
InputManager.
mouse
¶ A get accessor returning
MouseManager
object which exposes methods to check for mouse input. See theMouseManager
documentation for a full list of available methods.
-
InputManager.
controller
¶ A get accessor returning
ControllerManager
object which exposes methods to check for controller input. See theControllerManager
documentation for a full list of available methods.
-
InputManager.
system
¶ A get accessor returning
SystemManager
object which exposes methods to check for system input. See theSystemManager
documentation for a full list of available methods.
-
InputManager.
cursor_visible
¶ Gets or sets the visibility of the mouse cursor as
bool
.
Instance Methods:
-
InputManager.
events
()¶ Returns a list of
Event
objects that ocurred during the last frame. Check out theEvent
instance documentation for details.
-
InputManager.
register_callback
(event_type, callback_func)¶ Registers a callback function which will be called when specific event type(s) occur. Allows for an easy consumption of events you’re interested in.
The
event_type
parameter must be a specificEvent
subtype. You can also pass an iterable of those. Represents event type(s) you want to subscribe to.The
callback_func
must be a callable. It will get called each time given event type occurs, passing the event as parameter.from kaa.input import EventType def on_text_input(event): print('user typed this: {}'.format(event.keyboard_text.text)) def on_mouse_event(event): print('mouse button/wheel stuff happened!') # somewhere inside a Scene instance... self.input.register_callback(Event.keyboard_text, on_text_input) self.input.register_callback([Event.mouse_button, Event.mouse_wheel], on_mouse_event)
Only one callback for given event type can be registered at a time. Registering another callback with the same event type will overwrite the previous one:
from kaa.input import EventType def on_text_input_1(event): print('1 - user typed this: {}'.format(event.keyboard_text.text)) def on_text_input_2(event): print('2 - user typed this: {}'.format(event.keyboard_text.text)) # somewhere inside a Scene instance... self.input.register_callback(Event.keyboard_text, on_text_input_1) # this will cancel the previous callback (i.e. on_text_input_1 will never be called): self.input.register_callback(Event.keyboard_text, on_text_input_2)
If you pass
None
as callback_func, it will unregister the currently existing callback for that even type or do nothing if no callback for that type is currently registered.from kaa.input import EventType def on_text_input(event): print('user typed this: {}'.format(event.keyboard_text.text)) # somewhere inside a Scene instance... self.input.register_callback(Event.keyboard_text, on_text_input) self.input.register_callback(Event.keyboard_text, None) # unregisters the callback, on_text_input won't be called
KeyboardManager
reference¶
-
class
input.
KeyboardManager
¶
Keyboard manager can be accessed via the InputManager.keyboard property.
It allows to check the state (pressed or released) of given key.
Instance methods:
-
KeyboardManager.
is_pressed
(keycode)¶ Checks if a specific key is pressed - keycode param must be a
Keycode
enum value.from kaa.input import Keycode # somewhere inside a Scene instance... if self.input.keyboard.is_pressed(Keycode.w): # ... do something if w is pressed if self.input.keyboard.is_pressed(Keycode.W): # ... do something if W is pressed if self.input.keyboard.is_pressed(Keycode.return_): # ... do something if ENTER key is pressed
-
KeyboardManager.
is_released
(keycode)¶ Checks if a specific key is released - keycode param must be a
Keycode
enum value.from kaa.input import Keycode # somewhere inside a Scene instance... if self.input.keyboard.is_released(Keycode.w): # ... do something if w is released if self.input.keyboard.is_released(Keycode.W): # ... do something if W is released if self.input.keyboard.is_released(Keycode.return_): # ... do something if ENTER key is released
MouseManager
reference¶
-
class
input.
MouseManager
¶
Mouse manager can be accessed via the InputManager.mouse property.
The manager allows to check for the mouse buttons state (pressed/released). It also allows to get the mouse pointer position.
Instance properties:
-
MouseManager.
relative_mode
¶ Gets or sets relative mode (as bool). Default is
False
. Enabling relative mode has two effects: it hides the mouse pointer and it makes mouse motion events (MouseMotionEvent
) be published all the time (by default those events are published only if mouse moves within game’s window). Disabling the relative mode shows the mouse pointer and makes mouse motion events be published only if mouse movement occurs within the window.
-
MouseManager.
cursor_visible
¶ Gets or sets whether the system cursor pointer should be visible.
Instance methods:
-
MouseManager.
is_pressed
(mousebutton)¶ Checks if given mouse button is pressed - mousebutton param must be a
MouseButton
enum value.from kaa.input import MouseButton #somewhere inside a Scene instance... if self.input.mouse.is_pressed(MouseButton.left): # do something if the left mouse button is pressed
-
MouseManager.
is_released
(mousebutton)¶ Checks if given mouse button is released - mousebutton param must be a
MouseButton
enum value.from kaa.input import MouseButton #somewhere inside a Scene instance... if self.input.mouse.is_released(MouseButton.middle): # do something if the middle mouse button is released
-
MouseManager.
get_position
()¶ Returns current mouse pointer position as a
geometry.Vector
.IMPORTANT: the position is in the display screen frame of reference using the virtual resolution coordinate system). It is NOT a position of a mouse cursor on the scene. To convert the position to the scene frame of reference use the
engine.Camera.unproject_position()
method.#somewhere inside a Scene instance... pos = self.input.mouse.get_position(): print(pos) # V[145.234, 345.343]
ControllerManager
reference¶
-
class
input.
ControllerManager
¶
Controller Manager can be accessed via the InputManager.controller property.
The manager exposes methods for checking the state of controller’s buttons, sticks and triggers. All major controller types are supported.
Unlike mouse or keyboard, multiple controllers can be connected and used simultaneously, therefore all manager methods require passing a controller ID.
You can get the controller ID when controller is first connected. Kaa engine will publish a ControllerEvent
having connected
flag set to True
. An id
field on the event is the controller ID you’re looking
for.
When a controller disconnects, you will receive a ControllerEvent
with connected
flag set
to True
.
Your game code should always keep track of all currently connected controllers (their IDs).
Below is a basic example of keeping track of connected controller IDs and checking few selected properties of each connected controller:
from kaa.engine import Engine, Scene
from kaa.geometry import Vector
from kaa.input import Keycode, ControllerButton, ControllerAxis
class MyScene(Scene):
def __init__(self):
self.connected_controller_ids = []
self.frame_count = 0
def update(self, dt):
self.frame_count += 1
for event in self.input.events():
if event.controller_device:
if event.controller_device.is_added:
print('New controller connected: id is {}'.format(event.controller_device.id))
self.connected_controller_ids.append(event.controller_device.id)
elif event.controller_device.is_removed:
print('Controller disconnected: id is {}'.format(event.controller_device.id))
self.connected_controller_ids.remove(event.controller_device.id)
if event.system and event.system.quit:
self.engine.quit()
# Check a few properties of each connected controller:
for controller_id in self.connected_controller_ids:
a_button_pressed = self.input.controller.is_pressed(ControllerButton.a, controller_id)
b_button_pressed = self.input.controller.is_pressed(ControllerButton.b, controller_id)
left_stick_x = self.input.controller.get_axis_motion(ControllerAxis.left_x, controller_id)
left_stick_y = self.input.controller.get_axis_motion(ControllerAxis.left_y, controller_id)
print('Controller {}. A pressed:{}, B pressed:{}, left stick pos: {},{}'.format(controller_id,
a_button_pressed, b_button_pressed, left_stick_x, left_stick_y))
with Engine(virtual_resolution=Vector(400, 200)) as engine:
scene = MyScene()
engine.window.size = Vector(400, 200)
engine.window.center()
engine.run(scene)
Instance methods
-
ControllerManager.
is_connected
(controller_id)¶ Checks connection status of a given controller_id.
-
ControllerManager.
is_pressed
(controller_button, controller_id)¶ Checks if given controller button is pressed. The controller_button param must be a
ControllerButton
enum value. Check out the example above on how to obtain the controller_id.For example, to check the state of B button on controller 0:
from kaa.input import ControllerButton # somewhere in the Scene class: if self.input.controller.is_pressed(ControllerButton.b, 0): print('B is pressed on controller 0!')
-
ControllerManager.
is_released
(controller_button, controller_id)¶ Checks if given controller button is released on given controller. The controller_button param must be a
ControllerButton
enum value. Check out the example above on how to obtain the controller_id.For example, to check the state of B button on controller 2:
from kaa.input import ControllerButton # somewhere in the Scene class: if self.input.controller.is_released(ControllerButton.b, 2): print('B is released on controller 2!')
-
ControllerManager.
is_axis_pressed
(axis, controller_id)¶ Checks if given stick axes or trigger is in non-zero position. The axis param must be of
ControllerAxis
enum value. Check out the example above on how to obtain the controller_id.For example, to check if controller 1 left trigger is pressed:
from kaa.input import ControllerAxis # somewhere in the Scene class: if self.input.controller.is_axis_pressed(ControllerAxis.trigger_left, 1): print('Left trigger is pressed!')
-
ControllerManager.
is_axis_released
(axis, controller_id)¶ Same as above, but checks if given stick axes or trigger is in a zero position. The axis param must be of
ControllerAxis
enum value. Check out the example above on how to obtain the controller_id.
-
ControllerManager.
get_axis_motion
(axis, controller_id)¶ Gets an exact value of given stick axes motion or trigger as a number between 0 (stick axes or trigger in zero position) and 1 (stick axes or trigger in max position). The axis param must be of
ControllerAxis
enum value. Check out the example above on how to obtain the controller_id.For example, to check the state of controller 0 left trigger:
from kaa.input import ControllerAxis # somewhere in the Scene class: val = self.input.controller.get_axis_motion(ControllerAxis.trigger_right, 0): print('Controller 0, pulling left trigger {} percent :)'.format(val*100))
-
ControllerManager.
get_name
(controller_id)¶ Returns a name of a controller. Check out the example above on how to obtain the controller_id.
-
ControllerManager.
get_triggers
(controller_id)¶ Returns state of both triggers in a single
geometry.Vector
object. Vector’s x value is left trigger and vector’s y is right trigger. Check out the example above on how to obtain the controller_id.The values returned are between 0 (trigger is fully released) to 1 (trigger is fully pressed)
-
ControllerManager.
get_sticks
(compound_axis, controller_id)¶ Returns state of given stick as a
geometry.Vector
.The compound_axis parameter must be of
CompoundControllerAxis
enum value.Check out the example above on how to obtain the controller_id.
For example, to get the controller 1 left stick position:
# somewhere in the Scene class: val = self.input.controller.get_axis_motion(CompoundControllerAxis.left_stick, 1): print('Controller 1, left stick position is {}'.format(val))
SystemManager
reference¶
-
class
input.
SystemManager
¶
System Manager can be accessed via the InputManager.system property.
The manager exposes methods for working with system related input such as clipboard.
Instance methods:
-
SystemManager.
get_clipboard_text
()¶ Gets text from the system clipboard
-
SystemManager.
set_clipboard_text
(text)¶ Puts the
text
in the system clipboard
Event
reference¶
-
class
input.
Event
¶
As the game is running, a lot of things happen: the player may press or release keyboard keys
or mouse buttons, interact with controller, he can also interact with the window in which your game is running, e.g.
maximize or minimize it, and so on. Kaa engine detects all those events and makes them consumable either via
InputManager.events()
method or by registering a callback function InputManager.register_callback()
.
Each Event
instance has identical structure with the following instance properties:
type
- returns event typetimestamp
- returns time of the event occurrencesystem
- storesSystemEvent
instance if this event is a system related event, otherwise it will beNone
window
- storesWindowEvent
instance if this event is a window related event, otherwise it will beNone
keyboard_key
- storesKeyboardKeyEvent
instance if this event is a keyboard key related event, otherwise it will beNone
keyboard_text
- storesKeyboardTextEvent
instance if this event is a keyboard text related event, otherwise it will beNone
mouse_button
- storesMouseButtonEvent
instance if this event is a mouse button related event, otherwise it will beNone
mouse_motion
- storesMouseMotionEvent
instance if this event is a mouse motion related event, otherwise it will beNone
mouse_wheel
- storesMouseWheelEvent
instance if this event is a mouse wheel related event, otherwise it will beNone
controller_device
- storesControllerDeviceEvent
instance if this event is a controller device related event, otherwise it will beNone
controller_button
- storesControllerButtonEvent
instance if this event is a controller button related event, otherwise it will beNone
controller_axis
- storesControllerAxisEvent
instance if this event is a controller axis related event, otherwise it will beNone
audio
- storesAudioEvent
instance if this event is an audio related event, otherwise it will beNone
Depending on the type of the event only one property will be non-null while all the other properties will be null. This design usually results in a following way of handling events in the code:
# ... inside a Scene...
def update(self, dt):
for event in self.input.events():
if event.system:
# do something if it's a system event
elif event.window:
# do something if it's a window event
elif event.keyboard_key:
# do something if it's a keyboard key event
elif event.keyboard_text:
# do something if it's a keyboard text event
elif event.mouse_button:
# do something if it's a mouse button event
elif event.controller_button:
# do something if it's a controller button event
elif event.audio:
# do something if it's audio event
# ... and so on ...
Event class also has descriptors (“static properties”) that return appropariate event types:
Event.system - returns
SystemEvent
typeEvent.window - returns
WindowEvent
typeEvent.keyboard_key - returns
KeyboardKeyEvent
typeEvent.keyboard_text - returns
KeyboardTextEvent
typeEvent.mouse_button - returns
MouseButtonEvent
typeEvent.mouse_motion - returns
MouseMotionEvent
typeEvent.mouse_wheel - returns
MouseWheelEvent
typeEvent.controller_device - returns
ControllerDeviceEvent
typeEvent.controller_button - returns
ControllerButtonEvent
typeEvent.controller_axis - returns
ControllerAxisEvent
typeEvent.audio - returns
AudioEvent
type
which allows checking the type
property on the event instance:
# ... inside a Scene...
def update(self, dt):
for event in self.input.events():
if event.type == Event.system:
# do something
elif event.type == Event.keyboard_key:
# do something ...
elif event.type == Event.controller_axis:
# do something ...
# ... and so on
KeyboardKeyEvent
reference¶
-
class
input.
KeyboardKeyEvent
¶
Represents an event of pressing or releasing a keyboard key.
See also: KeyboardTextEvent
Instance properties:
-
KeyboardEvent.
is_key_down
¶ Returns
True
if the key was pressed.
-
KeyboardEvent.
is_key_up
¶ Returns
True
if the key was released.
KeyboardTextEvent
reference¶
-
class
input.
KeyboardTextEvent
¶
Represents an event of text being produced by the keyboard buffer. It lets you conveniently work with the text being typed in by the player.
Instance properties:
-
KeyboardTextEvent.
text
¶ Returns string with the text typed in.
For example, imagine a user with a polish keyboard pressing shift key, right alt and ‘s’ keys, holding it for some time and then releasing all pressed keys.
In a text editor it would result in typing something like this:
ŚŚŚŚŚŚ
The way ths will be represented in the kaaengine event flow:
You will first receive three
KeyboardKeyEvent
events: one for pressing the shift key, another for pressing the alt key and one for pressing the s keyYou will then receive a number of
KeyboardTextEvent
events, in this case we have six ‘Ś’ characters typed, so you will get six events. Reading thetext
property onKeyboardTextEvent
will return “Ś” string.Finally, you will first receive three
KeyboardKeyEvent
events: one for releasing the shift key, another for releasing the alt key and another one for releasing the s key
MouseMotionEvent
reference¶
-
class
input.
MouseMotionEvent
¶
Represents a mouse motion event (changing mouse pointer position). By default those events are published when
mouse pointer is within the window. You can enable the relative_mode
on the MouseManager
- it hides the
mouse pointer and makes mouse motion events be published whenever the pointer is moved (inside or outside of the
window).
# ... inside a Scene instance... for event in self.input.events(): if event.mouse_motion: print("Mouse motion detected! New position is: {}.".format(event.mouse_motion.position))
Instance properties:
-
MouseMotionEvent.
position
¶ Returns mouse pointer position as
geometry.Vector
. IMPORTANT: the position is in the display screen frame of reference (using the virtual resolution coordinate system). It is NOT a position of a mouse cursor on the scene. To convert the position to the scene frame of reference use theengine.Camera.unproject_position()
method on the Camera object.# somewhere inside the Scene instance: for event in self.input.events(): if event.mouse_motion: mouse_pos_absolute = event.mouse_button.position mouse_pos_on_scene = self.camera.unproject_position(mouse_pos_absolute)
-
MouseMotionEvent.
motion
¶ Returns mouse pointer motion (difference between the current and previous position) as
geometry.Vector
.
MouseWheelEvent
reference¶
-
class
input.
MouseWheelEvent
¶
Represents a mouse wheel related event.
Instance properties:
-
MouseWheelEvent.
scroll
¶ Returns a
geometry.Vector
indicating whether the mouse wheel was scrolled up or down. They
property in the returned vector holds the value, thex
will always be zero.# ... inside a Scene instance... for event in self.input.events(): if event.mouse_wheel: print("Mouse wheel event detected. Scroll is: {}.".format(event.mouse_wheel.scroll))
ControllerDeviceEvent
reference¶
Represents a controller device related event, such as controller connected or disconnected.
-
class
input.
ControllerDeviceEvent
¶ # ... inside a Scene instance... for event in self.input.events(): if event.controller_device: if event.controller_device.is_added: print("Controller with id={} connected.".format(event.controller_device.id) elif event.controller_device.is_removed: print("Controller with id={} disconnected.".format(event.controller_device.id)
Instance properties:
-
ControllerDeviceEvent.
id
¶ Returns an id of controller this event is referring to.
-
ControllerDeviceEvent.
is_added
¶ Returns
True
if controller was connected.
-
ControllerDeviceEvent.
is_removed
¶ Returns
True
if controller was disconnected.
ControllerAxisEvent
reference¶
Represents a controller axis related event, such as controller stick or trigger state change.
# ... inside a Scene instance... for event in self.input.events(): if event.controller_axis: print("Controller axis {} on controller id={} changed its state. New state is {}.".format( event.controller_axis.axis, event.controller_axis.id, event.controller_axis.motion)
-
class
input.
ControllerAxisEvent
¶
Instance properties
-
ControllerAxisEvent.
id
¶ Returns an id of controller this event is referring to.
-
ControllerAxisEvent.
axis
¶ Returns axis (controller stick or trigger) this event is referring to, as
ControllerAxis
enum value.
-
ControllerAxisEvent.
motion
¶ Returns the axis (controller stick or trigger) state, as a
geometry.Vector
. The length of the vector will be between 0 (stick or trigger is in neutral position) and 1 (stick or trigger is in its maximum position)
AudioEvent
reference¶
-
class
input.
AudioEvent
¶
Represents an audio related event.
Instance properties:
-
AudioEvent.
music_finished
¶ Returns
True
if current music track finished playing.
WindowEvent
reference¶
-
class
input.
WindowEvent
¶
Represents a window related event.
Instance properties:
-
WindowEvent.
is_shown
¶ Returns
True
if the window was shown.
-
WindowEvent.
is_exposed
¶ Returns
True
if the window was exposed.
-
WindowEvent.
is_moved
¶ Returns
True
if the window was moved.
-
WindowEvent.
is_resized
¶ Returns
True
if the window was resized.
-
WindowEvent.
is_minimized
¶ Returns
True
if the window was minimized.
-
WindowEvent.
is_maximized
¶ Returns
True
if the window was maximized.
-
WindowEvent.
is_restored
¶ Returns
True
if the window was restored.
-
WindowEvent.
is_enter
¶ Returns
True
if the mouse pointer entered the window area.
-
WindowEvent.
is_leave
¶ Returns
True
if the mouse pointer left the window area.
-
WindowEvent.
is_focus_gained
¶ Returns
True
if the window gained a focus.
-
WindowEvent.
is_focus_lost
¶ Returns
True
if the window lost a focus.
-
WindowEvent.
is_close
¶ Returns
True
if the window was closed.
SystemEvent
reference¶
-
class
input.
SystemEvent
¶
Represents a system related event.
Instance properties:
-
SystemEvent.
quit
¶ Returns
True
if the game proces is terminating.
-
SystemEvent.
clipboard_updated
¶ Returns
True
if the system clipboard was updated. You may callSystemManager.get_clipboard_text()
method to check out the text in the system clipboard.
Keycode
reference¶
-
class
input.
Keycode
¶
Enum type for referencing keyboard keys when working with KeyboardManager
and KeyboardKeyEvent
.
Available values are:
Keycode.unknown
Keycode.return_
Keycode.escape
Keycode.backspace
Keycode.tab
Keycode.space
Keycode.exclaim
Keycode.quotedbl
Keycode.hash
Keycode.percent
Keycode.dollar
Keycode.ampersand
Keycode.quote
Keycode.leftparen
Keycode.rightparen
Keycode.asterisk
Keycode.plus
Keycode.comma
Keycode.minus
Keycode.period
Keycode.slash
Keycode.num_0
Keycode.num_1
Keycode.num_2
Keycode.num_3
Keycode.num_4
Keycode.num_5
Keycode.num_6
Keycode.num_7
Keycode.num_8
Keycode.num_9
Keycode.colon
Keycode.semicolon
Keycode.less
Keycode.equals
Keycode.greater
Keycode.question
Keycode.at
Keycode.leftbracket
Keycode.backslash
Keycode.rightbracket
Keycode.caret
Keycode.underscore
Keycode.backquote
Keycode.a
Keycode.b
Keycode.c
Keycode.d
Keycode.e
Keycode.f
Keycode.g
Keycode.h
Keycode.i
Keycode.j
Keycode.k
Keycode.l
Keycode.m
Keycode.n
Keycode.o
Keycode.p
Keycode.q
Keycode.r
Keycode.s
Keycode.t
Keycode.u
Keycode.v
Keycode.w
Keycode.x
Keycode.y
Keycode.z
Keycode.A
Keycode.B
Keycode.C
Keycode.D
Keycode.E
Keycode.F
Keycode.G
Keycode.H
Keycode.I
Keycode.J
Keycode.K
Keycode.L
Keycode.M
Keycode.N
Keycode.O
Keycode.P
Keycode.Q
Keycode.R
Keycode.S
Keycode.T
Keycode.U
Keycode.V
Keycode.W
Keycode.X
Keycode.Y
Keycode.Z
Keycode.capslock
Keycode.F1
Keycode.F2
Keycode.F3
Keycode.F4
Keycode.F5
Keycode.F6
Keycode.F7
Keycode.F8
Keycode.F9
Keycode.F10
Keycode.F11
Keycode.F12
Keycode.printscreen
Keycode.scrolllock
Keycode.pause
Keycode.insert
Keycode.home
Keycode.pageup
Keycode.delete
Keycode.end
Keycode.pagedown
Keycode.right
Keycode.left
Keycode.down
Keycode.up
Keycode.numlockclear
Keycode.kp_divide
Keycode.kp_multiply
Keycode.kp_minus
Keycode.kp_plus
Keycode.kp_enter
Keycode.kp_1
Keycode.kp_2
Keycode.kp_3
Keycode.kp_4
Keycode.kp_5
Keycode.kp_6
Keycode.kp_7
Keycode.kp_8
Keycode.kp_9
Keycode.kp_0
Keycode.kp_period
Keycode.application
Keycode.power
Keycode.kp_equals
Keycode.F13
Keycode.F14
Keycode.F15
Keycode.F16
Keycode.F17
Keycode.F18
Keycode.F19
Keycode.F20
Keycode.F21
Keycode.F22
Keycode.F23
Keycode.F24
Keycode.execute
Keycode.help
Keycode.menu
Keycode.select
Keycode.stop
Keycode.again
Keycode.undo
Keycode.cut
Keycode.copy
Keycode.paste
Keycode.find
Keycode.mute
Keycode.volumeup
Keycode.volumedown
Keycode.kp_comma
Keycode.kp_equalsas400
Keycode.alterase
Keycode.sysreq
Keycode.cancel
Keycode.clear
Keycode.prior
Keycode.return2
Keycode.separator
Keycode.out
Keycode.oper
Keycode.clearagain
Keycode.crsel
Keycode.exsel
Keycode.kp_00
Keycode.kp_000
Keycode.thousandsseparator
Keycode.decimalseparator
Keycode.currencyunit
Keycode.currencysubunit
Keycode.kp_leftparen
Keycode.kp_rightparen
Keycode.kp_leftbrace
Keycode.kp_rightbrace
Keycode.kp_tab
Keycode.kp_backspace
Keycode.kp_a
Keycode.kp_b
Keycode.kp_c
Keycode.kp_d
Keycode.kp_e
Keycode.kp_f
Keycode.kp_xor
Keycode.kp_power
Keycode.kp_percent
Keycode.kp_less
Keycode.kp_greater
Keycode.kp_ampersand
Keycode.kp_dblampersand
Keycode.kp_verticalbar
Keycode.kp_dblverticalbar
Keycode.kp_colon
Keycode.kp_hash
Keycode.kp_space
Keycode.kp_at
Keycode.kp_exclam
Keycode.kp_memstore
Keycode.kp_memrecall
Keycode.kp_memclear
Keycode.kp_memadd
Keycode.kp_memsubtract
Keycode.kp_memmultiply
Keycode.kp_memdivide
Keycode.kp_plusminus
Keycode.kp_clear
Keycode.kp_clearentry
Keycode.kp_binary
Keycode.kp_octal
Keycode.kp_decimal
Keycode.kp_hexadecimal
Keycode.lctrl
Keycode.lshift
Keycode.lalt
Keycode.lgui
Keycode.rctrl
Keycode.rshift
Keycode.ralt
Keycode.rgui
Keycode.mode
Keycode.audionext
Keycode.audioprev
Keycode.audiostop
Keycode.audioplay
Keycode.audiomute
Keycode.mediaselect
Keycode.www
Keycode.mail
Keycode.calculator
Keycode.computer
Keycode.ac_search
Keycode.ac_home
Keycode.ac_back
Keycode.ac_forward
Keycode.ac_stop
Keycode.ac_refresh
Keycode.ac_bookmarks
Keycode.brightnessdown
Keycode.brightnessup
Keycode.displayswitch
Keycode.kbdillumtoggle
Keycode.kbdillumdown
Keycode.kbdillumup
Keycode.eject
Keycode.sleep
ControllerAxis
reference¶
-
class
input.
ControllerAxis
¶
Enum type for referencing controller axes when working with ControllerManager
and ControllerAxisEvent
.
Available values are:
ControllerAxis.left_y
ControllerAxis.left_x
ControllerAxis.right_x
ControllerAxis.right_y
ControllerAxis.trigger_left
ControllerAxis.trigger_right
CompoundControllerAxis
reference¶
-
class
input.
CompoundControllerAxis
¶
Enum type for referencing sticks (left or right) when working with some of ControllerManager
methods.
Available values are:
CompoundControllerAxis.left_stick
CompoundControllerAxis.right_stick