Tscope5
mouse.c File Reference

Go to the source code of this file.

Functions

Mouse GUI functions
void ts5_show_mouse ()
void ts5_hide_mouse ()
void ts5_set_mouse_position (double x, double y)
void ts5_get_mouse_position (double *x, double *y)
double ts5_get_mouse_x ()
double ts5_get_mouse_y ()
void ts5_draw_mouse_button (double x, double y)
Response registration

The mouse can also be used as a response device.

See timer.c for more information about response registration.

int ts5_define_mouse_key (int key)

Detailed Description

Definition in file mouse.c.


Function Documentation

void ts5_show_mouse ( )

Make the mouse cursor visible on the active display.

Definition at line 26 of file mouse.c.

void ts5_hide_mouse ( )

Make the mouse cursor invisible on the active display.

Definition at line 38 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.

Definition at line 53 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.

Definition at line 79 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 117 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 134 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:
bitmaps1.c, bitmaps2.c, bitmaps3.c, bitmaps4.c, bitmaps5.c, graphics1.c, graphics10.c, graphics2.c, graphics3.c, graphics4.c, graphics5.c, graphics6.c, graphics7.c, graphics8.c, graphics9.c, primitives1.c, primitives2.c, primitives3.c, primitives4.c, randomizer1.c, randomizer2.c, randomizer3.c, system1.c, textio2.c, textio3.c, textio4.c, textio5.c, timer1.c, timer2.c, timer3.c, timer4.c, timer5.c, and timer6.c.

Definition at line 155 of file mouse.c.

int ts5_define_mouse_key ( int  key)

Define a mouse key as a response key.

Parameters:
keyNumber of the key (keys are counted from 1).
Returns:
The reponse number associated with the key.

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

Definition at line 279 of file mouse.c.