Example of a mouse event

Top  Previous  Next

Aim is to show a box around the mouse cursor up to the next mouse click, e.g., as a catch area. In addition an event routine is registered as the first. The action procedure draws a frame with n=3 metre of radius and n is adjustable. The main routine waits for the click and then removes the routine again.

Event routine

void DLLENTRY moveProc (int art,

PZEICHENDATEN data,

short int x, short int y,

void * _userdata) {

int = _ userdata;

Colour definition fd;

data->addLine (data, fd, wheel, wheel, wheel);

data->addLine (data, fd, wheel, wheel, wheel,);

data->addLine (data, fd, wheel);

data->addLine (data, fd, wheel,);

}

Call

 

...

char text [100];

 

IOregisterEvent (EVENT_ART_MOUSEMOVE, moveProc, 3, TRUE);//Register

 

IOgetText (text, 100);//on input evaluate

 

IOregisterEvent (EVENT_ART_MOUSEMOVE, moveProc, 3, FALSE);//removing

...