Joypad Problems

BlitzMax Forums/BlitzMax Bug Reports/Joypad Problems

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Isn't that exactly what JoyCount does?

This...
Strict

Graphics 800, 400, 0

Repeat
	Local joyNum = JoyCount()
	Cls
	
	If joyNum
	  For Local thisPort = 0 Until joyNum
			Local joy$ = JoyName(thisPort) + " on port " + thisPort + " = "
			DrawText joy$, 0, thisPort * 14
			
	    For Local thisButton = 0 To Int(Log(JoyButtonCaps(thisPort)) / Log(2))
	      DrawText JoyDown(thisButton, thisPort), (TextWidth(joy$) + 1) + (thisButton * 24), thisPort * 14
	    Next
	  Next
	Else
		DrawText "No Joypads available", 0, 0
	endif
  
  Flip
Until KeyHit(KEY_ESCAPE) Or AppTerminate()

End
...certainly works fine for me whilst adding and removing joypads.

??


Although I'm still sceptical about your need for null values. ;o)

I agree that free ports probably should return null data, for the sake of tidiness if nothing else.


I'm also a bit curious as to why things have changed as I don't recall FreeJoy being updated, for windows at least, recently.