]> git.sur5r.net Git - cc65/blob - testcode/lib/mousetest.c
Added mousetest.c
[cc65] / testcode / lib / mousetest.c
1 #include <stdlib.h>
2 #include <mouse.h>
3 #include <conio.h>
4
5
6
7 int main (void)
8 {
9     struct mouse_pos pos;
10
11     clrscr ();
12     mouse_init (1, 1, MOUSE_C64);
13 /*    mouse_box (0, 29, 344, 250); */
14     while (1) {
15         if (kbhit()) {
16             switch (cgetc()) {
17                 case 's':   mouse_show ();      break;
18                 case 'h':   mouse_hide ();      break;
19                 case 'q':   mouse_done ();      exit (0);
20             }
21         }
22         mouse_pos (&pos);
23         gotoxy (0, 0);
24         cprintf ("%04X", pos.x);
25         gotoxy (0, 1);
26         cprintf ("%04X", pos.y);
27     }
28     return 0;
29 }
30
31
32