home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex087.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  1KB  |  28 lines

  1.                                        // Example: 087 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include  <stdio.h>
  4. short    num_buttons, button_var;
  5. short  main(void)
  6. {
  7.   dddInitKeybd();                      // Initialise the keyboard reading functions.
  8.   dddInitMouse();                      // Initialise the mouse drivers.
  9.   while  (dddkeycode!=_ESC)            // Loop until ESCape key is pressed.
  10.   {
  11.     button_var = dddMouseGetButtons(); // Read the status of the mouse buttons.
  12.     if  ((button_var & 1)!=0)          // If bit 0 is set then left mouse button is pressed.
  13.       {
  14.       printf("Your LEFT mouse button is pressed.\tPress ESC to quit.\n");
  15.       }
  16.     if  ((button_var & 2)!=0)          // If bit 1 is set then right mouse button is pressed.
  17.       {
  18.       printf("Your RIGHT mouse button is pressed.\tPress ESC to quit.\n");
  19.       }
  20.     if  (button_var ==0)               // If no buttons are pressed then inform the user.
  21.       {
  22.       printf("NO buttons are pressed.\tPress ESC to quit.\n");
  23.       }
  24.   }
  25.   dddRestoreKeybd();                   // Restore the dos keyboard routines.
  26.   return 0;                            // Bye.
  27. }
  28.