forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 2
Porting Godot 3: Input
Caroline Joy Bell edited this page Apr 15, 2024
·
1 revision
Note: Homebrodot adds set and get functions for various joypad sensors in Godot 3, which is not a feature present in upstream Godot 3 at the time of writing this (but was added in Godot 4).
Implementing input is a mostly freeform system in Godot 3; most of the platform code could be doing pretty much anything, as long as it updates the InputDefault
singleton. For interacting with it, there's a couple important things to note:
- Each input device (up to 16) has an id, which is an
int
-
InputDefault
expects Godot's input table values for reference of what button was just pressed.
- A function to process inputs, which should probably be run every loop within
OS:run()
for your platform. - Your input system must talk to the
DefaultInput
singleton for Godot to detect inputs.
- Handling for multiple controllers (input can be handled in a singular way for platforms where only one joypad is relevant, like handhelds)
- 2.x
- 3.x
- Nintendo Wii
- 3.5 for Nintendo Switch
- 3.5 for Playstation Vita
- 4.x
- *New* Nintendo 3DS
- 4.2 for Nintendo Wii U
- Nintendo Switch