Fixed GUI Input Mapping Demo Script Errors for 4.0-dev

Edited the project settings to match the new Godot 4 standard and fixed
the script errors which were making it impossible to run this demo.

Now everything works properly for the 4.0-dev version.

Changed to Vulkan Mobile + Changed argument name

Followed the suggestions of aaronfranke
Changed viewport size
This commit is contained in:
Voylin
2022-04-03 14:21:54 +09:00
parent e6c19ff4a9
commit 85e7aeec99
5 changed files with 32 additions and 56 deletions

View File

@@ -8,9 +8,9 @@ func _ready():
display_current_key()
func _toggled(button_pressed):
set_process_unhandled_key_input(button_pressed)
if button_pressed:
func _toggled(is_button_pressed):
set_process_unhandled_key_input(is_button_pressed)
if is_button_pressed:
text = "... Key"
release_focus()
else:
@@ -21,7 +21,7 @@ func _unhandled_key_input(event):
# Note that you can use the _input callback instead, especially if
# you want to work with gamepads.
remap_action_to(event)
pressed = false
button_pressed = false
func remap_action_to(event):
@@ -31,5 +31,5 @@ func remap_action_to(event):
func display_current_key():
var current_key = InputMap.get_action_list(action)[0].as_text()
var current_key = InputMap.action_get_events(action)[0].as_text()
text = "%s Key" % current_key