A day fixing gamepad issues...

I got a few new controllers today to test some stuff out. I've already tested it out on a PS3 controller, and now I was able to check it out on a 8BitDo Genesis style controller and an Xbox controller on the PC. I found a few issues with the way it does the button holding routine, for accessing spells, powering up weapons, etc. On some controllers it was only registering a press, not a hold. It registered a press, then nothing, then a release (it no longer showed it as pressed, but didn't show it as held or released either). It took a bit to track down what was causing it, because it first it just didn't seem to work when you hold down a button on the controller, but only on a gamepad, the keyboard was working just fine.

So I had to basically use some of my fun debugging tools I'd created, and was able to slowly track down the issue. The good thing is, once I realized it wasn't seeing it still being pressed, I just had to create an update poll that checked to see if it had been pressed at some point, say it was pressed even if the joystick polling wasn't saying it was pressed, and then keeping the internal value as pressed until the joystick polling said it was released. Really, once I figured out *why* it was doing what it was doing, it was a simple fix. But like 99% of bugs out there, finding out the way is the most time consuming part.

The good news is, while I was in there I added analogue input support for analogue sticks. Originally it was going to be just d-pad input only, but I figured, while I was messing around with the gamepad routines, might as well add in analogue support.

Really liking the genesis style 8bitdo- the genesis controller is one of my favorites, so it was great to test this out. Only thing I didn't like was that Love2d saw it as a PS4 controller, and not something else. Since I'm autochecking controllers to display which button does what, it did put a bit of a wrench in the works, but I think I might have some solutions.

Get Emberglass

Buy Now$5.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.