Hi,
I've been getting back to working on my key binding script for controller input, and I've been struggling with one aspect of it. The key binding for keyboard input is done, and works pretty well, but for the controller input I'm trying to make it so that the bindings for the left analog stick always mirror the bindings for the dpad, however I'm having trouble doing this.
Basically, I've been storing inputs directly from the project settings in a file then recalling them when the game starts. For each action, I always keep the keyboard input first, so when accessed as a list it has an index of 0, and the button for the controller input has an index of 1 in the same way. I would like to make it so that the left stick is third, at index 2, and is mapped in the same direction as the d pad, however there are some issues with this.
I originally had it so that the left stick binding is just copied from one input to the next if it is there, but this doesn't work if one direction from the dpad is completely unbinded; then the input is basically discarded and has nowhere to go. My initial solution to this problem is to have a perpetual binding in the input map with the joystick inputs, then to copy them over depending on if the d pad was used to bind them. However, this relates to an earlier problem I had where on the Steam Deck (Which I want to ensure compatibility for) if the d pad is bound in any place other than the default ui_up, ui_down ... actions then the input becomes weirdly unresponsive.
This is technically a separate issue, and I'm unsure if it is a Godot problem or a Steam Deck problem, but I think the core of the issue is that I'm not sure how to instantiate an event in the code. It seems so far that I'm only able to copy events generated from the controller or default input map. When they are saved to a file, they are in the format like:
Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
or Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
, but I'm not sure how to directly put one of these in line in the code and just have it added to the end of the action. If I could do that, then that would be fantastic, is there a way to define the object in such a way?

I've included the code in question, along with the working keyboard code. If anyone with some knowledge could help I'd greatly appreciate it.
Thanks