Tscope5
joystick.c File Reference

Definitions of joystick functions. More...

Go to the source code of this file.

Functions

Response registration

Joysticks can only be used as response devices.

See timer.c for more information about response registration.

int ts5_define_joystick_button (int device, int button)
 Define a joystick button as a response button. More...
 
int ts5_get_num_joysticks ()
 Get the number of joysticks that are connected to the system. More...
 
int ts5_get_num_joystick_buttons (int device)
 Get the number of buttons available on a joystick. More...
 

Detailed Description

Definitions of joystick functions.

Definition in file joystick.c.

Function Documentation

int ts5_define_joystick_button ( int  device,
int  button 
)

Define a joystick button as a response button.

Parameters
deviceNumber of the joystick (devices are numbered from 1).
buttonNumber of the button (buttons are counted from 1).
Returns
The reponse number associated with the button.

Give a positive number if you want to monitor button press events, a negative number if you want to monitor button release events.

Examples:
joystick01.c.

Definition at line 41 of file joystick.c.

int ts5_get_num_joysticks ( )

Get the number of joysticks that are connected to the system.

Returns
The number of joysticks that are connected to the system.
Examples:
joystick01.c.

Definition at line 111 of file joystick.c.

int ts5_get_num_joystick_buttons ( int  device)

Get the number of buttons available on a joystick.

Parameters
deviceNumber of the joystick (devices are numbered from 1).
Returns
The number of buttons on the joystick.
Examples:
joystick01.c.

Definition at line 127 of file joystick.c.