Tscope5
mouse.c File Reference

Definitions of mouse functions. More...

Go to the source code of this file.

Functions

Response registration

The mouse can be used as a response device.

See timer.c for more information about response registration.

int ts5_define_mouse_button (int button)
 Define a mouse button as a response button.
int ts5_get_num_mouse_buttons ()
 Get then number of buttons available on the mouse.
Mouse GUI functions
void ts5_show_mouse ()
 Make the mouse cursor visible on the active display.
void ts5_hide_mouse ()
 Make the mouse cursor invisible on the active display.
void ts5_set_mouse_position (double x, double y)
 Move the mouse pointer to position (x,y).
void ts5_get_mouse_position (double *x, double *y)
 Get the horizontal and vertical position of the mouse pointer.
double ts5_get_mouse_x ()
 Get the horizontal position of the mouse pointer.
double ts5_get_mouse_y ()
 Get the vertical position of the mouse pointer.
void ts5_draw_mouse_button (double x, double y)
 Draw a mouse button and wait for a click.

Detailed Description

Definitions of mouse functions.

Definition in file mouse.c.


Function Documentation

int ts5_define_mouse_button ( int  button)

Define a mouse button as a response button.

Parameters:
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:
mouse01.c, and mouse02.c.

Definition at line 46 of file mouse.c.

int ts5_get_num_mouse_buttons ( )

Get then number of buttons available on the mouse.

Returns:
The number of buttons on the mouse.
Examples:
mouse01.c.

Definition at line 105 of file mouse.c.

void ts5_show_mouse ( )

Make the mouse cursor visible on the active display.

Examples:
mouse01.c, and mouse02.c.

Definition at line 128 of file mouse.c.

void ts5_hide_mouse ( )

Make the mouse cursor invisible on the active display.

Examples:
mouse01.c, and mouse02.c.

Definition at line 140 of file mouse.c.

void ts5_set_mouse_position ( double  x,
double  y 
)

Move the mouse pointer to position (x,y).

Parameters:
xHorizontal position of the mouse on the active display.
yVertical position of the mouse on the active display.
Examples:
mouse01.c, and mouse02.c.

Definition at line 155 of file mouse.c.

void ts5_get_mouse_position ( double *  x,
double *  y 
)

Get the horizontal and vertical position of the mouse pointer.

Parameters:
xVariable that will store the horizontal position.
yVariable that will store the vertical position.

You can pass NULL for values you are not interested in.

Examples:
mouse02.c.

Definition at line 184 of file mouse.c.

double ts5_get_mouse_x ( )

Get the horizontal position of the mouse pointer.

Returns:
The horizontal position of the mouse pointer.

Definition at line 224 of file mouse.c.

double ts5_get_mouse_y ( )

Get the vertical position of the mouse pointer.

Returns:
The vertical position of the mouse pointer.

Definition at line 241 of file mouse.c.

void ts5_draw_mouse_button ( double  x,
double  y 
)

Draw a mouse button and wait for a click.

Parameters:
xHorizontal position of the button on the active display.
yVertical position of the button on the active display.

The button has an ugly green color. This color can not be changed. This is not a bug. It is a Deliberately Annoying Feature (DAF).

Examples:
bitmaps01.c, bitmaps02.c, bitmaps03.c, bitmaps04.c, bitmaps05.c, cedrusbox01.c, display01.c, display01.cpp, display02.c, display03.c, display04.c, display05.c, graphics01.c, graphics02.c, graphics03.c, graphics04.c, graphics05.c, graphics06.c, graphics07.c, graphics08.c, graphics09.c, graphics10.c, joystick01.c, keyboard01.c, mouse01.c, mouse02.c, parport01.c, primitives01.c, primitives02.c, primitives03.c, primitives04.c, randomizer01.c, randomizer02.c, randomizer03.c, textio01.c, textio02.c, textio03.c, textio04.c, textio05.c, timer01.c, timer02.c, timer03.c, timer04.c, timer05.c, and timer06.c.

Definition at line 262 of file mouse.c.