+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?

asked Jun 10, 2017 in Engine by Cameron Kilgore (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 How to use this Q&A? before posting your first questions.