]> git.sur5r.net Git - cc65/blobdiff - samples/geos/geosconio.c
New feature missing_char_term
[cc65] / samples / geos / geosconio.c
index 6e116f7920fafd92b930af7b38e5d662f14b4e16..1c728f8514fc1d00477d577919c17dd14fed0758 100644 (file)
@@ -1,9 +1,11 @@
 
 #include <geos.h>
 #include <conio.h>
+#include <mouse.h>
 
 void main(void) {
 
+struct mouse_info info;
 char ch;
 
     DlgBoxOk("Now the screen will be", "cleared.");
@@ -27,8 +29,30 @@ char ch;
        cputc(ch);
     } while (ch!='.');
 
-    DlgBoxOk("Seems that it is all.", "Bye.");
-
-    EnterDeskTop();
+    DlgBoxOk("Seems that it is all for conio.", "Let's test mouse routines.");
+    
+    mouse_init(1);
+    cputsxy(0,2,CBOLDON "Now you can't see mouse (press any key)" CPLAINTEXT);
+    mouse_hide();
+    while (!kbhit()) { };
+    cputc(cgetc());
+    cputsxy(0,3,CBOLDON "Now you see the mouse (press any key)" CPLAINTEXT);
+    mouse_show();
+    while (!kbhit()) { };
+    cputc(cgetc());
+
+       /* Get the current mouse coordinates and button states and print them */
+       mouse_info (&info);
+       gotoxy (0, 4);
+               cprintf ("X  = %3d", info.pos.x);
+       gotoxy (0, 5);
+       cprintf ("Y  = %3d", info.pos.y);
+       gotoxy (0, 6);
+       cprintf ("LB = %c", (info.buttons & MOUSE_BTN_LEFT)? '1' : '0');
+       gotoxy (0, 7);
+       cprintf ("RB = %c", (info.buttons & MOUSE_BTN_RIGHT)? '1' : '0');
+
+
+    DlgBoxOk("Bye,", "Bye.");
 
 }