Possible glitch

Previous topic - Next topic

Darmakwolf

I noticed (at least on my computer, have yet to try this on others,) with NO controller plugged in, GETDIGIY(0) returns -1. The moment I plug in a controller hub or any other controller, it returns 0.

Test it with this:
WHILE TRUE
PRINT GETDIGIX(0),5,5
PRINT GETDIGIY(0),5,25
SHOWSCREEN
WEND

with a controller plugged in, the proper value of Y should be 0. Unplugged for me it's showing up as -1.  :giveup:

Darmakwolf

Okay. It was pretty much me just coding inefficiently  :x

Basically let's say you poll joystick 0 and joystick 1, seeing what we get for input from the 1st two joysticks plugged into the computer. If they're indeed plugged in, of course you get proper input. If you had other controllers plugged in before, even if they are not not, you'll get erroneous data from the commands. To solve this, use GETNUMJOYSTICKS() and loop through available joysticks to get proper data from connected devices. Well now I know I guess :P

MrTAToad

In addition, adding or removing joysticks during program execution will not update GETNUMJOYSTICKS