Subsections

Mouse support

Defined in mouse.h and mouse.c.

This is a small set of functions, that can be used for two purposes.

The first is giving instructions to participants. One function draws a box around some text (instructions) you generate with the standard text output functions, another function puts a click-to-continue-button on the screen.

The other mouse functions activate or hide a mouse pointer, and report the coordinates of the mouse pointer on the screen. Mouse button presses can be registered trough the standard response functions. These functions can be used to generate more complex user interfaces, or for example to implement a Corsi block tapping task (see examples).

void ts_textbox (int x1, int y1, int x2, int y2);

Draws a frame between points (x1,y1) and (x2,y2). Within this frame text can be put using the standard text output functions.

void ts_button (int x, int y);

Draws a button around point (x,y). Loads the mouse driver if necessary and draws a mouse-pointer to the screen. Left-clicking the button continues the program.

void ts_drawmouse();

Loads the mouse driver if necessary and draws a mouse pointer on the screen.

void ts_hidemouse();

Hides the mouse pointer.

int ts_xmouse();

Returns the horizontal position of the mouse pointer

int ts_ymouse();

Returns the vertical position of the mouse pointer

void ts_mousepos (int x, int y);

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

int ts_mousecolor (int color);

Changes the color of the mouse pointer. Returns the previous color value.


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information