Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | consolingstars |
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).
Sorry for the rookie question but I am still a beginner and learning from these online courses but nothing seem to work and there is no one to ask the queries.
My button 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()
and the popup 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.
Could you please help me fix this issue.