CLASS v1.8.0

InputAction

pykraken.InputAction

Represents a single input trigger such as a key, mouse button, or gamepad control.

At a glance

1 members

Reference

PYTHON API

Constructor

method5 overloads
InputAction(scancode: Scancode)
InputAction(keycode: Keycode)
InputAction(mouse_button: MouseButton)
InputAction(gamepad_button: GamepadButton, slot: int = 0)
InputAction(gamepad_axis: GamepadAxis, is_positive: bool, slot: int = 0)

Overloaded function.

  1. InputAction(scancode: Scancode)

Create an input action from a scancode.

Args

  • scancode (Scancode) — Keyboard scancode.
  1. InputAction(keycode: Keycode)

Create an input action from a keycode.

Args

  • keycode (Keycode) — Keyboard keycode.
  1. InputAction(mouse_button: MouseButton)

Create an input action from a mouse button.

Args

  • mouse_button (MouseButton) — Mouse button code.
  1. InputAction(gamepad_button: GamepadButton, slot: int = 0)

Create an input action from a gamepad button.

Args

  • gamepad_button (GamepadButton) — Gamepad button code.
  • slot (int, optional) — Gamepad slot (default is 0).
  1. InputAction(gamepad_axis: GamepadAxis, is_positive: bool, slot: int = 0)

Create an input action from a gamepad axis direction.

Args

  • gamepad_axis (GamepadAxis) — Gamepad axis code.
  • is_positive (bool) — True for positive direction, False for negative.
  • slot (int, optional) — Gamepad slot (default is 0).

Find your next step

Start typing to search the manual.