]> git.sur5r.net Git - cc65/blob - samples/geos/geosconio.c
replaced reference to vlink utility with grc call with proper options
[cc65] / samples / geos / geosconio.c
1
2 #include <geos.h>
3 #include <conio.h>
4 #include <mouse.h>
5
6 void main(void) {
7
8 struct mouse_info info;
9 char ch;
10
11     DlgBoxOk("Now the screen will be", "cleared.");
12     
13     clrscr();
14     
15     DlgBoxOk("Now a character will be", "written at 20,20");
16     
17     gotoxy(20,20);
18     cputc('A');
19
20     DlgBoxOk("Now a string will be", "written at 0,1");
21     
22     cputsxy(0,1, CBOLDON "Just" COUTLINEON  "a " CITALICON "string." CPLAINTEXT );
23
24     DlgBoxOk("Write text and finish it", "with a dot.");
25
26     cursor(1);
27     do {
28         ch = cgetc();
29         cputc(ch);
30     } while (ch!='.');
31
32     DlgBoxOk("Seems that it is all for conio.", "Let's test mouse routines.");
33     
34     mouse_init(1);
35     cputsxy(0,2,CBOLDON "Now you can't see mouse (press any key)" CPLAINTEXT);
36     mouse_hide();
37     while (!kbhit()) { };
38     cputc(cgetc());
39     cputsxy(0,3,CBOLDON "Now you see the mouse (press any key)" CPLAINTEXT);
40     mouse_show();
41     while (!kbhit()) { };
42     cputc(cgetc());
43
44         /* Get the current mouse coordinates and button states and print them */
45         mouse_info (&info);
46         gotoxy (0, 4);
47         cprintf ("X  = %3d", info.pos.x);
48         gotoxy (0, 5);
49         cprintf ("Y  = %3d", info.pos.y);
50         gotoxy (0, 6);
51         cprintf ("LB = %c", (info.buttons & MOUSE_BTN_LEFT)? '1' : '0');
52         gotoxy (0, 7);
53         cprintf ("RB = %c", (info.buttons & MOUSE_BTN_RIGHT)? '1' : '0');
54
55
56     DlgBoxOk("Bye,", "Bye.");
57
58     EnterDeskTop();
59
60 }