home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / volume_3.zip / MOUSE.H < prev    next >
C/C++ Source or Header  |  1995-10-07  |  4KB  |  124 lines

  1. #ifndef __MOUSE_H
  2.     #define __MOUSE_H
  3.  
  4.  
  5. #define TRUE -1
  6. #define FALSE 0
  7. #define OR ||
  8. #define AND &&
  9. #define    RESETMOUSE 0x0000
  10. #define MOUSE_INTERRUPT 0x33
  11. #define SHOWMOUSE 0x01
  12. #define HIDEMOUSE 0x02
  13. #define MOUSEPOSITION 0x03
  14. #define MOVEMOUSE 0x04
  15. #define BUTTON_PRESS_XY 0x05
  16. #define BUTTON_RELEASE_XY 0x06
  17. #define MOUSELIMITX 0x07
  18. #define MOUSELIMITY 0x08
  19. #define CURSORSHAPE 0x09
  20. #define HIDEMOUSEXY 0x10
  21. #define MOUSEMOTION 0x0B
  22. #define SETMOUSESENSITIVITY 0x1A
  23. #define GETMOUSESENSITIVITY 0x1B
  24. #define JOYSTICK_RESET 0x8400
  25. #define JOYSTICK_INTERRUPT 0x15
  26. #define JOYSTICKBUTTONS 0
  27. #define BOOL(x) (!(!(x)))
  28. #define JOYSTICK_XY 1
  29. #include "c:\tc\mouse.cpp"
  30.  
  31. //Mouse Functions
  32.  
  33.  
  34.  
  35.  //Checks to see if mouse is present and sets MousePresent to TRUE or FALSE
  36.  //Returns True if Mouse present, FALSE otherwise
  37. extern int Detect_Mouse(void);
  38.  
  39.  //Returns number of mouse buttons available.
  40.  //Uses same call as Detect_Mouse, just wanted a seperate function
  41.  //for it, but it will reset mouse!
  42. extern int Number_Of_Buttons(void);
  43.  
  44. //Moves mouse to new X,Y position.
  45. extern void Move_Mouse(int Mouse_X,int Mouse_Y);
  46.  
  47. //Shows Mouse cursor
  48. extern void Display_Mouse(void);
  49.  
  50. //Hides Mouse cursor
  51. extern void Hide_Mouse(void);
  52.  
  53. //X & Y are set to current mouse X,Y position
  54. //returns 0x00 if no     mouse button pressed
  55. //        0x01 if left   mouse button pressed
  56. //        0x02 if right  mouse button pressed
  57. //        0x04 if center mouse button pressed
  58. extern int Mouse_Position(int *Mouse_X,int *Mouse_Y);
  59.  
  60. //Same as above, will return the value of the button HELD down
  61. //Simplier function call
  62. extern int Mouse_Status(void);//Checks to see if any mouse buttons held down
  63.  
  64. //Sets Mouse Y limits of movement
  65. extern void Vert_Mouse_Limit(int Mouse_Y_Min,int Mouse_Y_Max);
  66.  
  67. //Sets Mouse X limits of movement
  68. extern void Horiz_Mouse_Limit(int Mouse_X_Min,int Mouse_X_Max);
  69.  
  70. //Gets the current mouse settings Speed_X   = Horiz mickeys per 8 pixels
  71. //                                Speed_Y   = Vert  mickeys per 8 pixels
  72. //                                threshold = Double speed threshold in mickeys per second
  73. extern void Mouse_Sens(int Speed_X,int Speed_Y,int threshold);
  74.  
  75. //Same as above but sets the values.
  76. void Mouse_Sens(int Speed_X,int Speed_Y,int threshold);
  77.  
  78.  
  79. //Mickeys_X and Y returns the number of mickeys moved since
  80. //LAST call to this function
  81. extern void Mouse_Motion(int *Mickeys_X,int *Mickeys_Y);
  82.  
  83. //Changes current mouse shape
  84. //default         0 >   Arrow
  85. //cursor_select = 1     Space Ship
  86. //                2     Car
  87. //                3     Hand
  88. //                4     HourGlass
  89. //                5     Text
  90. //                6     Pencil
  91. extern void Cursor_Shape(int cursor_select);
  92.  
  93. //This Function starts a Forever LOOP until the mouse
  94. //Button is released!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  95. extern void Button_Up(void);
  96.  
  97.  
  98. //Button_Check is set to the same value as below
  99. //this will check the particular button and then
  100. //the function will
  101. //return 0x00 if no     mouse button pressed
  102. //       0x01 if left   mouse button pressed
  103. //       0x02 if right  mouse button pressed
  104. //       0x04 if center mouse button pressed
  105. //X & Y are set to current mouse X,Y position of Button Release
  106. int Button_Release_XY(int *Mouse_X,int *Mouse_Y,int Button_Check);
  107.  
  108.  
  109.  
  110. //Joystick Functions
  111. extern int JoyStick_Switches(int *switch_0,int *switch_1,int *switch_2,int *switch_3);
  112. extern int JoyStick_XY(int *A_X,int *A_Y,int *B_X,int *B_Y);
  113.  
  114. //**********************************************************
  115. //**** Hide's mouse in a particular section of screen      *
  116. //**** This will turn off Mouse Display                    *
  117. //**** & won't turn it back on so use Display_Mouse        *
  118. //**** It's better to just test the mouse X,Y so that      *
  119. //**** when it's in a region you can just use Hide_Mouse() *
  120. //**********************************************************
  121. extern void Hide_Mouse_XY(int left_X,int right_X,int top_Y,int bottom_Y);
  122.  
  123. #endif
  124. //EOF