

I’m mostly experienced in c++ and python, but I would use a dictionary/map/associative array/whatever name you call it, where you put keypress/event/… as key, and a function with the result you want as value (as a first version, there’s other more specialised ways, but this will be enough for most cases).
If there’s a case/switch statement in gdscript (that’s what you’re using I think?), you could also look into that, though I think it’s likely just syntactic sugar for either what you’re already doing or what I suggested, but it might be easier to read, so there’s that.








Good point, this probably also allows players to remap inputs if they want.