#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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) |
|
|