Eblo / mkxp-z-eulogy

Fork from mkxp-z for Eulogy of an Insect
https://github.com/mkxp-z/mkxp-z/wiki
GNU General Public License v2.0
1 stars 0 forks source link

Last input does not account for deadzones #3

Closed Eblo closed 4 months ago

Eblo commented 4 months ago

Controllers can have analog stick drift, hence the concept of deadzones. SDL seems quite sensitive enough to sense anything the controller does, including analog stick movement when the player is not using them. This interferes with both detecting the last input and the last input device.

A simple fix would be to apply a deadzone that ignores the last input logic unless the absolute value of the analog input is greater than some threshold. Ideally this threshold should be configurable during runtime.

Eblo commented 4 months ago

Fixed by 290cf0c. Due to the SDL lifecycle, the deadzone logic responsibility has been split across mkxp and the game itself. mkxp will only use the deadzone to decide if an axis motion event should change the last input device, while Ruby is left to actually filter inputs against the deadzone.