id axes balls hats buttons axis ball hat button
JoyAxisEvent JoyBallEvent JoyHatEvent JoyButtonUpEvent JoyButtonDownEvent
Joystick.new( id )
Creates a new joystick object. id is a number smaller than Joystick.count. This will also start events for this joystick.
Joystick.count
Returns the amount of joysticks attached to the computer.
Joystick#id
Returns the id of the joystick as it was passed to Joystick.new.
Joystick#axes
Returns the amount of axes the joystick has.
Joystick#balls
Returns the amount of trackballs the joystick has.
Joystick#hats
Returns the amount of hats the joystick has.
Joystick#buttons
Returns the amount of buttons the joystick has.
Joystick#axis( nr )
Returns the state of axis nr, which is between -1 to 1.
Joystick#ball( nr )
Returns the state of ball nr, which is an array of [dx, dy] where dx and dy are between -1 to 1.
Joystick#hat( nr )
Returns the state of hat nr, which is an array of [dx, dy] where dx and dy can be -1, 0 or 1.
Joystick#button( nr )
Returns the boolean state of button nr.
Contains id which is the joysticknumber, value which is the movement, ranging from -1 to 1 and axis which is the axis index.
Contains id which is the joysticknumber, ball which is a trackball index and rel which is a movement array of [dx, dy].
Contains id which is the joysticknumber, hat which is the hatnumber and a movement array of [dx, dy] called value where dx and dy can be -1, 0 or 1.
Contains id which is the joysticknumber and button which is the button index.
Contains id which is the joysticknumber and button which is the button index.
Back to index