en fr

Sysquake Pro – Table of Contents

Sysquake – Table of Contents

Sysquake for LaTeX – Table of Contents

Extension - Joystick

This section describes functions which read the state of a joystick. Currently, these functions are available on Windows, Mac and Linux computers.

Functions

joystickbuttons

Get the state of the joystick buttons.

Syntax

b = joystickbuttons(i)

Description

joystickbuttons(i) gives the state of the buttons of the joystick i. Each buttons corresponds to a bit of the result; for instance, if the result of joystickbuttons(1) is 4, the 3rd button of the first joystick is pressed (4 is 2^(3-1), while all other buttons are released.

See also

joystickpos, joysticklist

joysticklist

List of joysticks connected to the computer.

Syntax

l = joysticklist

Description

joysticklist gives the list of the joysticks connected to the computer. Each element is a string which contains the name of the joystick. Empty string represent joystick not connected. Joysticks are listed in the same order as the index of the joystick used as input argument of joystickbuttons and joystickpos.

See also

joystickbuttons, joystickpos

joystickpos

Get the state of the joystick buttons.

Syntax

pos = joystickpos(i)

Description

joystickpos(i) gives the position of the joystick i as a vector whose elements are normalized between -1 and 1. For a standard joystick, the first component is between -1 for left and 1 for right; the second component, between -1 for forward (joystick pushed) and 1 for backward (pulled); and additional components depend on the joystick and the driver.

See also

joystickbuttons, joysticklist