0 votes
public override void _UnhandledKeyInput(InputEventKey @event)
{
    InputEventKey inputEventkey = @event;

    if ( inputEventkey.IsActionPressed("reload") )
    {
        GD.Print("Reload");
        reload = true;
    }

    if ( inputEventkey.IsActionPressed("mode") )
    {
        CycleMode();
    }

}

It's printing reload twice

any ideas?

EDIT: I found the problem. Turns out because my current scene is a child of a Viewport node and i tried to put this code in the viewport to enable object picking and this what causes it. But now i can't use object picking.

public override void _Input(InputEvent @event)
{
    UnhandledInput(@event);
}
Godot version 3.3.4
in Engine by (34 points)
edited by

1 Answer

0 votes

Broken mechanical key switch.
https://tesorotec.com/support/key-chattering/

by (889 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.