mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 07:50:22 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user