The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+1 vote

I am trying to use a Popup node to capture a keypress event, as a means of creating a configuration screen for keybindings (that would later update InputMap).

When a Button event is fired, the popup takes over and the User is prompted to press a key. However, the event I am using to track keypresses when the popup is over, is never being fired. I'm not clear on whether or not this is the best manner to track keypresses in this state.

The button event code is:

func _on_CharacterForward_button_down():
    # Open Keybinding Popup
    get_node("ButtonBindPrompt/BindNotice").set_text(
        "Press the button you want to bind to Forward or press Esc to cancel."
    )
    get_node("ButtonBindPrompt").popup_centered()
    get_node("ButtonBindPrompt").grab_focus()

The Popup Input Event code is:

func _on_ButtonBindPrompt_input_event( ev ):
    if ev.type == InputEvent.KEY:
        var evt = ev #added for tracking a breakpoint event that never occurs.

Any leads on what I could be doing wrong?

in Engine by (62 points)

Please log in or register to answer this question.

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.