home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  4.2 KB  |  136 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ident    "@(#)/usr/include/sys/mouse.h.sl 1.1 4.0 12/08/90 3657 AT&T-USL"
  11.  
  12. #define BUTCHNGMASK    0x38
  13. #define MOVEMENT    0x40
  14.  
  15. #define BUTSTATMASK    7
  16. #define BUT3STAT    1
  17. #define BUT2STAT    2
  18. #define BUT1STAT    4
  19. #define BUT3CHNG    8
  20. #define BUT2CHNG    0x10
  21. #define BUT1CHNG    0x20
  22.  
  23. struct mse_event {
  24.     unchar    type;        /* event type (see below) */
  25.     unchar    code;         /* when type is XQ_MOTION or XQ_BUTTON, =>
  26.                     bit 0 clear if right button pushed;
  27.                     bit 1 clear if middle button pushed;
  28.                     bit 2 clear if left button pushed; */
  29.     char    x;        /* delta x movement (mouse motion only) */
  30.     char    y;        /* delta y movement (mouse motion only) */
  31. };
  32.  
  33. #define    MSE_BUTTON    0
  34. #define    MSE_MOTION    1
  35.  
  36. struct mouseinfo {       
  37.     unsigned char    status;
  38.     char    xmotion, ymotion;
  39. };
  40.  
  41. /* Ioctl Command definitions */
  42.  
  43. #define MOUSEIOC        ('M'<<8)
  44. #define MOUSEIOCREAD    (MOUSEIOC|60)
  45. #define MOUSEISOPEN     (MOUSEIOC|66)
  46. #define MOUSE320        (MOUSEIOC|67)
  47. #define MSEBUTTONS    (MOUSEIOC|68)
  48. #define TS_CALIB    (MOUSEIOC|70)    /* Touch screen: set the calibration */
  49. #define TS_RECALIB    (MOUSEIOC|71)    /* Touch screen: disable calibration */
  50. #define TS_CURPOS    (MOUSEIOC|72)    /* Touch screen: set cursor position */
  51. #define MOUSEIOCDELAY    (MOUSEIOC|80)
  52. #define MOUSEIOCNDELAY    (MOUSEIOC|81)
  53. #define MOUSEIOCCONFIG    (MOUSEIOC|100)
  54. #define MOUSEIOCMON    (MOUSEIOC|101)
  55.  
  56. #define VPC_MOUSE_READ  MOUSEIOCREAD
  57.  
  58. #define UPPERLIM    127
  59. #define LOWERLIM    -128
  60. #define ONEBYTE(x)    ((x)>UPPERLIM?UPPERLIM:(x)<LOWERLIM?LOWERLIM:(x))
  61.  
  62. /* 320 mouse command/query structure */
  63.  
  64. struct    cmd_320 {
  65.     int    cmd;
  66.     int    arg1;
  67.     int    arg2;
  68.     int    arg3;
  69. };
  70.  
  71. /*
  72.  * AT&T 320 (PS/2 style) Mouse Commands 
  73.  */
  74. #define    MSERESET    0xff    /* reset mouse */
  75. #define    MSERESEND    0xfe    /* resend last data stream */
  76. #define    MSESETDEF    0xf6    /* set default status */
  77. #define    MSEOFF        0xf5    /* disable mouse */
  78. #define    MSEON        0xf4    /* enable mouse */
  79. #define    MSECHGMOD    0xf3    /* set sampling rate and/or button mode */
  80. #define    MSEGETDEV    0xf2    /* read device type */
  81. #define    MSESPROMPT    0xf0    /* set prompt mode (resets stream mode) */
  82. #define    MSEECHON    0xee    /* set echo mode */
  83. #define    MSEECHOFF    0xec    /* reset echo mode */
  84. #define    MSEREPORT    0xeb    /* read mouse report */
  85. #define    MSESTREAM    0xea    /* set Incremental Stream Mode */
  86. #define    MSESTATREQ    0xe9    /* status request */
  87. #define    MSESETRES    0xe8    /* set counts per mm. resolution */
  88. #define MSESCALE2    0xe7    /* set 2:1 scaling */
  89. #define MSESCALE1    0xe6    /* set 1:1 scaling */
  90.  
  91. /*
  92.  * 320 mouse 8042 controller commands and flags
  93.  */
  94. #define MSE_ROP        0xD0    /* read output port command */
  95. #define MSE_RIP        0xC0    /* read input port command */
  96. #define MSE_WOP        0xD3    /* write to loopback command */
  97. #define MSE_WAD        0xD4    /* write to device command */
  98. #define    MSE_RCB        0x20    /* read command byte command */
  99. #define    MSE_WCB        0x60    /* write command byte command */
  100. #define MSE_INBF    0x03    /* input/output buffer full flag */
  101. #define MSE_OUTBF    0x21    /* output buffer full flag */
  102. #define    MSE_ENAB    0xA8    /* enable 8042 interface */
  103. #define    MSE_DISAB    0xA7    /* disable 8042 interface */
  104. #define MSE_ACK        0xFA    /* Acknowledgement byte from 8042 */
  105.  
  106. typedef struct mouseinfo MOUSEINFO;
  107.  
  108. /*
  109.  * Begin Carrol touch screen-specific definitions.
  110.  */
  111.  
  112. /*
  113.  * Calibration data structure.    Used with TS_CALIB ioctl to register the upper
  114.  * left opto-coordinate that cooresponds to the upper left corner of the active
  115.  * video area, and the lower right opto-coordinate that cooresponds to the
  116.  * lower right corner of the active video area.
  117.  */
  118.  
  119. struct ts_calib {
  120.     int    c_ulx,    /* upper left X opto-coordinate of active video area */
  121.         c_uly,    /* upper left Y opto-coordinate of active video area */
  122.         c_lrx,    /* lower right X opto-coordinate of active video area */        c_lry;    /* lower right Y opto-coordinate of active video area */};
  123.  
  124. /*
  125.  * Position cursor at the given "pixel" coordinate.
  126.  */
  127.  
  128. struct ts_curpos {
  129.     int    p_xpos, /* X cursor coordinate */
  130.         p_ypos;    /* Y cursor coordinate */
  131. };
  132.  
  133. /*
  134.  * End Carrol touch screen-specific difinitions.
  135.  */
  136.