mirror of
https://github.com/cc65/cc65.git
synced 2024-12-22 12:30:41 +00:00
Added mousetest.c
git-svn-id: svn://svn.cc65.org/cc65/trunk@878 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
3e887bd9dd
commit
d6b16ff116
32
testcode/lib/mousetest.c
Normal file
32
testcode/lib/mousetest.c
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <mouse.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
struct mouse_pos pos;
|
||||||
|
|
||||||
|
clrscr ();
|
||||||
|
mouse_init (1, 1, MOUSE_C64);
|
||||||
|
/* mouse_box (0, 29, 344, 250); */
|
||||||
|
while (1) {
|
||||||
|
if (kbhit()) {
|
||||||
|
switch (cgetc()) {
|
||||||
|
case 's': mouse_show (); break;
|
||||||
|
case 'h': mouse_hide (); break;
|
||||||
|
case 'q': mouse_done (); exit (0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mouse_pos (&pos);
|
||||||
|
gotoxy (0, 0);
|
||||||
|
cprintf ("%04X", pos.x);
|
||||||
|
gotoxy (0, 1);
|
||||||
|
cprintf ("%04X", pos.y);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user