home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Drivers / joystick-0.0-I / joystick.next / joystick.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-09  |  1.4 KB  |  39 lines

  1. #ifndef _NEXT_JOYSTICK_H
  2. #define _NEXT_JOYSTICK_H
  3.  
  4. #define JS_RETURN sizeof(struct JS_DATA_TYPE)    /*number of bytes returned by js_read*/
  5.  
  6. #define JS_MAX 2        /*Max number of joysticks*/
  7.  
  8. #define JS_SET_CAL 0x01        /*ioctl cmd to set joystick correction factor*/
  9. #define JS_GET_CAL 0x02        /*ioctl cmd to get joystick correction factor*/
  10. #define JS_SET_TIMEOUT 0x03    /*ioctl cmd to set maximum number of iterations
  11.                   to wait for a timeout*/
  12. #define JS_GET_TIMEOUT        0x04    /*as above, to get*/
  13. #define JS_SET_TIMELIMIT    0x05    /*set data retention time*/
  14. #define JS_GET_TIMELIMIT    0x06    /*get data retention time*/
  15. #define JS_GET_ALL        0x07    /*get the whole JS_DATA[minor] struct*/
  16. #define JS_SET_ALL        0x08    /*set the whole JS_DATA[minor] struct
  17.                           except JS_BUSY!*/
  18.  
  19. /*This union is used for the ioctl to set the scaling factor and to return
  20.   the current values for a joystick. 'buttons' is ignored on the ioctl call*/
  21.  
  22. struct JS_DATA_TYPE {
  23.     int buttons;
  24.     int x;
  25.     int y;
  26. };
  27.  
  28. /* This struct is used for misc data about the joystick*/
  29. struct JS_DATA_SAVE_TYPE {
  30.     int JS_TIMEOUT;        /*timeout*/
  31.     int BUSY;        /*joystick is in use*/
  32.     long JS_EXPIRETIME;    /*Time when stick after which stick must be re-read*/
  33.     long JS_TIMELIMIT;    /*Max time before data is invalid*/
  34.     struct JS_DATA_TYPE JS_SAVE;    /*last read data*/
  35.     struct JS_DATA_TYPE JS_CORR;    /*correction factor*/
  36. };
  37.  
  38. #endif /* _NEXT_JOYSTICK_H */
  39.