Skip to content
Search

Godot:InputMap

lastmod 2020-09-20created 2020-09-205 edits

godot - User input.

Action

An action lets you group multiple inputs into a single action group.

Events

Key
Keyboard
Joy Button
Joystick button
Joy Axis
Joystick analog control
Mouse Button
Touchpad and mouse input.
For smartphone screen touches, use Device 0, Left Button.

Example

To handle inputs grouped under the ui_accept action, use the Godot.Input.IsActionJustPressed function.

using Godot;
using System;

public class Piano : Node2D
{
    // ...

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(float delta)
    {
        if (Godot.Input.IsActionJustPressed("ui_accept"))
        {
            GD.Print("Left Mouse.");
        }
    }

    // ...
}

Classes

See also

Favorite site

author Zer0 sitemap