Feature request: Expose controller deadzone to lua
It appears as though the default deadzone for Solarus is 500 "units of something" (lol): https://gitlab.com/solarus-games/solarus/-/blob/b758e1cd19f0e35a607871e54fdc8e54aa3e4407/src/core/InputEvent.cpp#L48
However, with a deadzone this low, modern Xbox controllers have a consistent jitter, and axis don't return to their 0 axis state.
I tested by upping the deadzone to 9000 using solarus command line options (solarus-run -joypad-deadzone=9000
), and this felt just about perfect for my controller. However, we ought to open this up to the Lua API so that games can let players adjust this to work with their controllers.
Reproduction project: https://gitlab.com/maxmraz/solarus-1.7-controls-test Branch: deadzone-test
The game will open up with a menu which displays the left analog stick's axis state. With an Xbox controller, you will notice it does not perfectly return to the same spot. The corner of the white box should line up with the corner of the cross. Increasing the deadzone caused the corners to correctly line up for me.