IsJoystick(#Number) - Checks if joystick is connected.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

IsJoystick(#Number) - Checks if joystick is connected.

Post by DarkDragon »

Hello,

As I want to check up to about 8 joysticks I need a function telling me how many are connected to the PC or a function which returns if a joystick with the specific number is connected and can be examined. ExamineJoystick just notifies the debugger as if it is a fatal error to check a non-existing joystick. Without debugger it works.

Thanks,
Daniel
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

InitJoystick() returns the number of connected joystick, and can be called again if you want to check if a new one is available.
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Fred wrote:InitJoystick() returns the number of connected joystick, and can be called again if you want to check if a new one is available.
Ah, good to know :lol: . Sorry for the mistake (It's a bit hard to to keep track of the commands for me).

[EDIT]
But the Debugger still says: "InitJoystick() can only be called once." and stops the program.
bye,
Daniel
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Ha yes, i will remove the debug check, thanks.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Fred, maybe you shouldn't do that.
leave the check but add a wrapper called GetJoysticks() or something.
That way the InitJoystick() will keep behaving like all other Init functions. (can only be called once)
Post Reply