Key are not redefining

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cobra!
:warning: Old Version Published before Godot 3 was released.

I’m trying to add a menu for redefining the keys for my game, and found this documents page that gives me code for that, however, it doesn’t work…

Here is my code:

func _input(event):
if buttonPressable:
	if takingInputs:
		if event.type == InputEvent.KEY:
			event.type = InputEvent.ACTION
			event.set_as_action(action, true)
			takingInputs = false
			buttonPressed = false
			buttonPressable = false
			option.reshowItem(str(key))
			hide()

What am I doing wrong?

:bust_in_silhouette: Reply From: Cobra!

Nevermind, I figured it out, I followed this source code and that worked for me: https://github.com/akien-mga/dynadungeons/blob/master/scripts/controls.gd