![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | YuleTide |
I have managed to use an event to allow a user to change keymappings as part of the menu. I have a saved config file and I want to make sure when the user logs in the changed key settings stay in place. To do this I have saved the scancodes of the keys selected as part of the event but I am having problems using the scancodes to change the key mappings the next time I log into the game.
Can anyone tell me how to either convert the scancode into a form that I can use to change the keymappings or else how to use the scancodes directly to do this?
As some context this is the code I have tried
scan_code = $"/root/GloVars".move_left
var new_k = InputEventKey.new()
new_k.set_scancode(scan_code)
InputMap.action_add_event("move_left", scan_code)
but it fails with the error
Invalid type in function “action add event” in base inputmap. Cannot convert arguement 2 from int to object
YuleTide | 2022-07-09 21:25