WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   Check presence of joysticks ? (

hotspur1 05-08-2010 05:36 AM

Check presence of joysticks ?
Is there a way to check if any USB joysticks are plugged into the computer?

It seems when vizjoy is imported, it checks for joysticks since I get a message on the output panel NOTIFY: 0 joysticks found.

Is there a way to intercept this notification?

Thanks in advance

farshizzo 05-18-2010 10:33 AM

The following code shows how to detect all the attached joysticks:

import vizjoy
joysticks = []
while True:
        joy = vizjoy.add()
        if joy.valid():
print len(joysticks),'joysticks detected'

All times are GMT -7. The time now is 12:45 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC