WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   2 Joysticks / requirements (https://forum.worldviz.com/showthread.php?t=1777)

Sandro Holzer 01-13-2009 05:39 AM

2 Joysticks / requirements
 
Hi

Is it possible to use 2 USB - Joysticks in one environment, and how to do it?
I would like to use one for driving a vehicle, and the other one to manipulate an arm from the Vehicle.
And what are general the requirements for Joysticks to use with the vizjoy module? Are they plug&play or do i have to install drivers?
For example would the Logitech Attack 3 work (or two of them).
Or the SPEED LINK - SL-6632 PC DARK TORNADO JOYSTICK ?

Sorry I canīt post links, because in our company websites that are game related are blocked.

Thanks in advance for your answers

Sandro

farshizzo 01-13-2009 04:32 PM

Yes, each call to vizjoy.add() will return the next available joystick. Here is a sample script that shows how to connect to multiple joysticks:
Code:

import viz
import vizjoy
viz.go()

joy1 = vizjoy.add()
joy2 = vizjoy.add()

def joydown(e):
        if e.joy == joy1:
                print 'Joystick 1 button',e.button,'pressed'
        elif e.joy == joy2:
                print 'Joystick 2 button',e.button,'pressed'
       
viz.callback(vizjoy.BUTTONDOWN_EVENT,joydown)



All times are GMT -7. The time now is 03:49 AM.

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