.


, , "" . .

/* "" Microsoft/IBM */

#include "dos.h"

#define NOT_MOVED 0

#define RIGHT 1

#define LEFT 2

#define UP 3

#define DOWN 4

void mouse_position(), mode(), goto_xy(), mouse_motion();

void cursor_on(), cursor_off(), mouse_reset();

main(argc, argv)

int argc;

char *argv[];

char deltax, deltay, x, y;

if(argc!=2)

printf(" : mouser <> ");

exit(1);

mode(atoi(argv[1]));

mouse_reset(); /* "" */

cursor_on(); /* "" ࠠ */

do

goto_xy(0, 0);

if(leftb_presed()) printf(" ");

if(rightb_pressed())

printf(" ");

mouse_position(&x, &y);

printf("%d %d - ", x, y);

/* "" */

mouse_motion(&deltax, &deltay);

if(deltax || deltay)

printf("");

switch(deltax)

case NOT_MOVED: break;

case RIGHT: printf("");

break;

case LEFT: printf("");

break;

switch(deltay)

case NOT_MOVED: break;

case UP: printf("");

break;

case DOWN: printf("");

break;

/* */

while(!(leftb_pressed() && rightb_pressed()));

mode(3);

/* */

void mode(mode_code)

int mode_code;

union REGS r;

r.h.ah=2; /* */

r.h.dl = y; /* */

r.h.dh = x; /* */

r.h.bh = 0; /* */

int86(0x10, &r, &r);

/**********************************************************/

/* , "" */