index
index
gets/sets which joystick being used.
Type: integer
Range: 0 - 7
Note:
The
first joystick is always 0.
Sample
Code
################### Get index
# get controller
controller = GameLogic.getCurrentController()
# get sensor attached to controller named FlightStick
sen = controller.sensors["FlightStick"]
# get joystick being used
jStick = sen.index
################### Set index
# get controller
controller = GameLogic.getCurrentController()
# get sensor attached to controller named FlightStick
sen = controller.sensors["FlightStick"]
# set joystick being used
sen.index = 0
|