Skip to content

New extension: Input manager #1638

@moolbie

Description

@moolbie

Description

The extension adds an input management system to GDevelop, allowing you to define and map custom input axes and keys. It provides:

  • Input Axes: Define axes with positive and negative keys (e.g., "Horizontal" with A/D or Left/Right, "Vertical" with W/S or Up/Down). Axes return values of -1, 0, or 1.
  • Input Keys: Define custom named inputs that return true or false when pressed or released (e.g., a "Jump" input mapped to Space).
  • Dynamic Input Mapping: Allows adding, modifying, and checking custom inputs and axes at runtime.
  • Event Conditions & Actions: Check if an input key is pressed, released, or held, and retrieve axis values for movement or other gameplay mechanics.

How to use the extension

  1. Create Input Keys and Axes (Custom / Predefined)

    • For custom input keys or axes, use the "Add Input Key" or "Add Input Axis" action.
    • For predefined inputs, use the "Add Default 3D Inputs" action.
  2. Detect Key Presses

    • For axes, use the InputManager::InputAxis(Name) expression, which returns -1, 0, or 1 based on the keys pressed.
    • For keys, use the "Input Pressed" or "Input Released" condition.

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

Input manager example.zip

Extension file

InputManager.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions