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,ControllerManagerandSystemManager- they offer methods to actively check for input from your code. For instance, you can ask theKeyboardManagerif 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 theEventdocumentation 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
KeyboardManagerobject which exposes methods to check for keyboard input. See theKeyboardManagerdocumentation for a full list of available methods.
-
InputManager.mouse¶ A get accessor returning
MouseManagerobject which exposes methods to check for mouse input. See theMouseManagerdocumentation for a full list of available methods.
-
InputManager.controller¶ A get accessor returning
ControllerManagerobject which exposes methods to check for controller input. See theControllerManagerdocumentation for a full list of available methods.
-
InputManager.system¶ A get accessor returning
SystemManagerobject which exposes methods to check for system input. See theSystemManagerdocumentation 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
Eventobjects that ocurred during the last frame. Check out theEventinstance 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_typeparameter must be a specificEventsubtype. You can also pass an iterable of those. Represents event type(s) you want to subscribe to.The
callback_funcmust 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
Noneas 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
Keycodeenum 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
Keycodeenum 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
MouseButtonenum 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
MouseButtonenum 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
ControllerButtonenum 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
ControllerButtonenum 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
ControllerAxisenum 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
ControllerAxisenum 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
ControllerAxisenum 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.Vectorobject. 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
CompoundControllerAxisenum 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
textin 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- storesSystemEventinstance if this event is a system related event, otherwise it will beNonewindow- storesWindowEventinstance if this event is a window related event, otherwise it will beNonekeyboard_key- storesKeyboardKeyEventinstance if this event is a keyboard key related event, otherwise it will beNonekeyboard_text- storesKeyboardTextEventinstance if this event is a keyboard text related event, otherwise it will beNonemouse_button- storesMouseButtonEventinstance if this event is a mouse button related event, otherwise it will beNonemouse_motion- storesMouseMotionEventinstance if this event is a mouse motion related event, otherwise it will beNonemouse_wheel- storesMouseWheelEventinstance if this event is a mouse wheel related event, otherwise it will beNonecontroller_device- storesControllerDeviceEventinstance if this event is a controller device related event, otherwise it will beNonecontroller_button- storesControllerButtonEventinstance if this event is a controller button related event, otherwise it will beNonecontroller_axis- storesControllerAxisEventinstance if this event is a controller axis related event, otherwise it will beNoneaudio- storesAudioEventinstance 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
SystemEventtypeEvent.window - returns
WindowEventtypeEvent.keyboard_key - returns
KeyboardKeyEventtypeEvent.keyboard_text - returns
KeyboardTextEventtypeEvent.mouse_button - returns
MouseButtonEventtypeEvent.mouse_motion - returns
MouseMotionEventtypeEvent.mouse_wheel - returns
MouseWheelEventtypeEvent.controller_device - returns
ControllerDeviceEventtypeEvent.controller_button - returns
ControllerButtonEventtypeEvent.controller_axis - returns
ControllerAxisEventtypeEvent.audio - returns
AudioEventtype
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
Trueif the key was pressed.
-
KeyboardEvent.is_key_up¶ Returns
Trueif 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
KeyboardKeyEventevents: 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
KeyboardTextEventevents, in this case we have six ‘Ś’ characters typed, so you will get six events. Reading thetextproperty onKeyboardTextEventwill return “Ś” string.Finally, you will first receive three
KeyboardKeyEventevents: 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.Vectorindicating whether the mouse wheel was scrolled up or down. Theyproperty in the returned vector holds the value, thexwill 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
Trueif controller was connected.
-
ControllerDeviceEvent.is_removed¶ Returns
Trueif 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
ControllerAxisenum 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
Trueif current music track finished playing.
WindowEvent reference¶
-
class
input.WindowEvent¶
Represents a window related event.
Instance properties:
-
WindowEvent.is_shown¶ Returns
Trueif the window was shown.
-
WindowEvent.is_exposed¶ Returns
Trueif the window was exposed.
-
WindowEvent.is_moved¶ Returns
Trueif the window was moved.
-
WindowEvent.is_resized¶ Returns
Trueif the window was resized.
-
WindowEvent.is_minimized¶ Returns
Trueif the window was minimized.
-
WindowEvent.is_maximized¶ Returns
Trueif the window was maximized.
-
WindowEvent.is_restored¶ Returns
Trueif the window was restored.
-
WindowEvent.is_enter¶ Returns
Trueif the mouse pointer entered the window area.
-
WindowEvent.is_leave¶ Returns
Trueif the mouse pointer left the window area.
-
WindowEvent.is_focus_gained¶ Returns
Trueif the window gained a focus.
-
WindowEvent.is_focus_lost¶ Returns
Trueif the window lost a focus.
-
WindowEvent.is_close¶ Returns
Trueif the window was closed.
SystemEvent reference¶
-
class
input.SystemEvent¶
Represents a system related event.
Instance properties:
-
SystemEvent.quit¶ Returns
Trueif the game proces is terminating.
-
SystemEvent.clipboard_updated¶ Returns
Trueif 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.unknownKeycode.return_Keycode.escapeKeycode.backspaceKeycode.tabKeycode.spaceKeycode.exclaimKeycode.quotedblKeycode.hashKeycode.percentKeycode.dollarKeycode.ampersandKeycode.quoteKeycode.leftparenKeycode.rightparenKeycode.asteriskKeycode.plusKeycode.commaKeycode.minusKeycode.periodKeycode.slashKeycode.num_0Keycode.num_1Keycode.num_2Keycode.num_3Keycode.num_4Keycode.num_5Keycode.num_6Keycode.num_7Keycode.num_8Keycode.num_9Keycode.colonKeycode.semicolonKeycode.lessKeycode.equalsKeycode.greaterKeycode.questionKeycode.atKeycode.leftbracketKeycode.backslashKeycode.rightbracketKeycode.caretKeycode.underscoreKeycode.backquoteKeycode.aKeycode.bKeycode.cKeycode.dKeycode.eKeycode.fKeycode.gKeycode.hKeycode.iKeycode.jKeycode.kKeycode.lKeycode.mKeycode.nKeycode.oKeycode.pKeycode.qKeycode.rKeycode.sKeycode.tKeycode.uKeycode.vKeycode.wKeycode.xKeycode.yKeycode.zKeycode.AKeycode.BKeycode.CKeycode.DKeycode.EKeycode.FKeycode.GKeycode.HKeycode.IKeycode.JKeycode.KKeycode.LKeycode.MKeycode.NKeycode.OKeycode.PKeycode.QKeycode.RKeycode.SKeycode.TKeycode.UKeycode.VKeycode.WKeycode.XKeycode.YKeycode.ZKeycode.capslockKeycode.F1Keycode.F2Keycode.F3Keycode.F4Keycode.F5Keycode.F6Keycode.F7Keycode.F8Keycode.F9Keycode.F10Keycode.F11Keycode.F12Keycode.printscreenKeycode.scrolllockKeycode.pauseKeycode.insertKeycode.homeKeycode.pageupKeycode.deleteKeycode.endKeycode.pagedownKeycode.rightKeycode.leftKeycode.downKeycode.upKeycode.numlockclearKeycode.kp_divideKeycode.kp_multiplyKeycode.kp_minusKeycode.kp_plusKeycode.kp_enterKeycode.kp_1Keycode.kp_2Keycode.kp_3Keycode.kp_4Keycode.kp_5Keycode.kp_6Keycode.kp_7Keycode.kp_8Keycode.kp_9Keycode.kp_0Keycode.kp_periodKeycode.applicationKeycode.powerKeycode.kp_equalsKeycode.F13Keycode.F14Keycode.F15Keycode.F16Keycode.F17Keycode.F18Keycode.F19Keycode.F20Keycode.F21Keycode.F22Keycode.F23Keycode.F24Keycode.executeKeycode.helpKeycode.menuKeycode.selectKeycode.stopKeycode.againKeycode.undoKeycode.cutKeycode.copyKeycode.pasteKeycode.findKeycode.muteKeycode.volumeupKeycode.volumedownKeycode.kp_commaKeycode.kp_equalsas400Keycode.alteraseKeycode.sysreqKeycode.cancelKeycode.clearKeycode.priorKeycode.return2Keycode.separatorKeycode.outKeycode.operKeycode.clearagainKeycode.crselKeycode.exselKeycode.kp_00Keycode.kp_000Keycode.thousandsseparatorKeycode.decimalseparatorKeycode.currencyunitKeycode.currencysubunitKeycode.kp_leftparenKeycode.kp_rightparenKeycode.kp_leftbraceKeycode.kp_rightbraceKeycode.kp_tabKeycode.kp_backspaceKeycode.kp_aKeycode.kp_bKeycode.kp_cKeycode.kp_dKeycode.kp_eKeycode.kp_fKeycode.kp_xorKeycode.kp_powerKeycode.kp_percentKeycode.kp_lessKeycode.kp_greaterKeycode.kp_ampersandKeycode.kp_dblampersandKeycode.kp_verticalbarKeycode.kp_dblverticalbarKeycode.kp_colonKeycode.kp_hashKeycode.kp_spaceKeycode.kp_atKeycode.kp_exclamKeycode.kp_memstoreKeycode.kp_memrecallKeycode.kp_memclearKeycode.kp_memaddKeycode.kp_memsubtractKeycode.kp_memmultiplyKeycode.kp_memdivideKeycode.kp_plusminusKeycode.kp_clearKeycode.kp_clearentryKeycode.kp_binaryKeycode.kp_octalKeycode.kp_decimalKeycode.kp_hexadecimalKeycode.lctrlKeycode.lshiftKeycode.laltKeycode.lguiKeycode.rctrlKeycode.rshiftKeycode.raltKeycode.rguiKeycode.modeKeycode.audionextKeycode.audioprevKeycode.audiostopKeycode.audioplayKeycode.audiomuteKeycode.mediaselectKeycode.wwwKeycode.mailKeycode.calculatorKeycode.computerKeycode.ac_searchKeycode.ac_homeKeycode.ac_backKeycode.ac_forwardKeycode.ac_stopKeycode.ac_refreshKeycode.ac_bookmarksKeycode.brightnessdownKeycode.brightnessupKeycode.displayswitchKeycode.kbdillumtoggleKeycode.kbdillumdownKeycode.kbdillumupKeycode.ejectKeycode.sleep
ControllerAxis reference¶
-
class
input.ControllerAxis¶
Enum type for referencing controller axes when working with ControllerManager and ControllerAxisEvent.
Available values are:
ControllerAxis.left_yControllerAxis.left_xControllerAxis.right_xControllerAxis.right_yControllerAxis.trigger_leftControllerAxis.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_stickCompoundControllerAxis.right_stick