home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / PEN / PENTKT / PENBASE / INC / PENIOCTL.H < prev    next >
Text File  |  1995-04-14  |  38KB  |  627 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /*************************************************************************/
  13. /*                                                                       */
  14. /*                                                                       */
  15. /*************************************************************************/
  16. /******************* START OF SPECIFICATIONS *****************************/
  17. /*                                                                       */
  18. /*  SOURCE FILE NAME: PENIOCTL.H                                         */
  19. /*                                                                       */
  20. /*  DESCRIPTIVE NAME: Pen IOCTL interface                                */
  21. /*                                                                       */
  22. /*                                                                       */
  23. /*  STATUS:  Version 1.0                                                 */
  24. /*                                                                       */
  25. /*  NOTES:                                                               */
  26. /*                                                                       */
  27. /*  ENTRY POINTS:                                                        */
  28. /*      See public statements                                            */
  29. /*  EXTERNAL REFERENCES:                                                 */
  30. /*      See extrn statements                                             */
  31. /*                                                                       */
  32. /******************* END  OF  SPECIFICATIONS *****************************/
  33. /*****************************************************************************/
  34. /* Generic IOCTL Summary                                                     */
  35. /*                                                                           */
  36. /* This is the list of architected IOCTL calls.                              */
  37. /*                                                                           */
  38. /* Category  Code    Description                                             */
  39. /*                                                                           */
  40. /* 90H - DRIVER                                                              */
  41. /*                                                                           */
  42. /*           50H     Set Unit Specific Data                                  */
  43. /*           51H     Set Unit Variable                                       */
  44. /*           52H     Reset Trace Table                                       */
  45. /*           53H     Set Trace Table Size                                    */
  46. /*                                                                           */
  47. /*           60H     Query Unit Specific Data                                */
  48. /*           61H     Query Unit Variable                                     */
  49. /*           62H     Query Unit Capabilities                                 */
  50. /*           63H     Query Trace Table                                       */
  51. /*           64H     Query Trace Table Size                                  */
  52. /*                                                                           */
  53. /* 91H - LOCATOR                                                             */
  54. /*                                                                           */
  55. /*           51H     Set Locator Offset                                      */
  56. /*           52H     Set Locator Pass Rate                                   */
  57. /*           53H     Set Locator Sample Rate                                 */
  58. /*                                                                           */
  59. /*           60H     Query Locator Variables                                 */
  60. /*           61H     Query Locator Raw Coordinate                            */
  61. /*           62H     Query Default Locator Extents                           */
  62. /*                                                                           */
  63. /* 92H - BUTTON                                                              */
  64. /*                                                                           */
  65. /*           50H     Set Button Assignment                                   */
  66. /*                                                                           */
  67. /*           60H     Query Button Assignment                                 */
  68. /*                                                                           */
  69. /* 93H - DISPLAY                                                             */
  70. /*                                                                           */
  71. /*           50H     Set Display State                                       */
  72. /*           51H     Set Display Inactivity Period                           */
  73. /*                                                                           */
  74. /*           60H     Query Display State                                     */
  75. /*                                                                           */
  76. /*                                                                           */
  77. /* ERROR_INVALID_PARAMETER (0x087h) is return for invalid unit or for        */
  78. /* parameters out of the specified range.                                    */
  79. /*                                                                           */
  80. /* General defines                                                           */
  81.  
  82. #define PEN_CAT_DRIVER  0x090     /* Driver category        */
  83. #define PEN_CAT_LOCATOR 0x091     /* Locator category       */
  84. #define PEN_CAT_BUTTON  0x092     /* Button category        */
  85. #define PEN_CAT_DISPLAY 0x093     /* Display category       */
  86.  
  87. #define PEN_IOCTL_LEV_MAJOR 0     /* IOCTL interface level  */
  88. #define PEN_IOCTL_LEV_MINOR 4     /* IOCTL interface level  */
  89.  
  90. /*****************************************************************************/
  91. /* Category 90H - Function 50H: Set Unit Specific Data                       */
  92. /*                                                                           */
  93. /* This command sets the device specific data for the requested unit.        */
  94.  
  95. /* Parameter Packet Format */
  96. typedef struct _P_SUSD       {    /* psusd */
  97.   ULONG   unit;                   /* requested unit  */
  98.   ULONG   byteCount;              /* byte count of the device specific data area */
  99. } PSUSD;
  100.  
  101. /* Data Packet Format - Device Specific Structure, first LONG has btye count */
  102.  
  103. /* Defines */
  104. #define PEN_FUNC_SUSD 0x050        /* Set Unit Specific Data */
  105.  
  106.  
  107. /****************************************************************************/
  108. /* Category 90H - Function 51H: Set Unit Variable                           */
  109. /*                                                                          */
  110. /* This command sets the device specific variable for the requested unit.   */
  111.  
  112. /* Parameter Packet Format */
  113. typedef struct _P_SUV        {    /* psuv */
  114.   ULONG   unit;                   /* requested unit     */
  115.   ULONG   index;                  /* index of variable to set */
  116.   LONG    value;                  /* value to set             */
  117. } PSUV;
  118.  
  119. /* Data Packet Format - None */
  120.  
  121. /* Defines */
  122. #define PEN_FUNC_SUV 0x051        /* Set unit variable */
  123.  
  124. /*****************************************************************************/
  125. /* Category 90H - Function 52H: Reset Trace Table                            */
  126. /*                                                                           */
  127. /* This resets the transaction trace buffer.Reseting the trace buffer        */
  128. /* is a convenient way view only current stroke data.                        */
  129. /* Parameter Packet Format - None                                            */
  130. /* Data Packet Format - None                                                 */
  131. /* Defines                                                                   */
  132. #define PEN_FUNC_RTT 0x052        /* Reset Trace Table                       */
  133.  
  134. /*****************************************************************************/
  135. /* Category 90H - Function 53H: Set Trace Table Size                         */
  136. /*                                                                           */
  137. /* This command allocates a trace table for use of traceing.                 */
  138.  
  139. /* Parameter Packet Format */
  140. typedef struct _P_STTS       {    /* pstts */
  141.   ULONG   size;                   /* Number of LONG values in table */
  142.                                   /*  (number of bytes / 4) */
  143. } PSTTS;
  144.  
  145. /* Data Packet Format - None                                                 */
  146.  
  147. /* Defines                                                                   */
  148. #define PEN_FUNC_STTS 0x053        /* Set Trace Table Size                   */
  149.  
  150. /**************************************************************************  */
  151. /* Category 90H - Function 60H: Query Unit Specific Data                     */
  152. /*                                                                           */
  153. /* This command reads the device specific data for the requested unit. The   */
  154. /* device specific data area is truncated when the pqusd.byteCount is less   */
  155. /* than the length of device specific data. The first ULONG in unit specific */
  156. /* is by convention the entire length of the area. This is not reduced to    */
  157. /* reflect a truncated query.                                                */
  158.  
  159. /* Parameter Packet Format                                                   */
  160. typedef struct _P_QUSD       {    /* pqusd */
  161.   ULONG   unit;                   /* requested unit                          */
  162.   ULONG   byteCount;              /* byte count of the device specific data  */
  163.   ULONG   RetByteCount;           /* bytes returned (output parm)            */
  164.   ULONG   rc;                     /* return code    (output parm)            */
  165.   ULONG   capabilities;           /* capabilities   (output parm)            */
  166. } PQUSD;
  167.  
  168. /* Data Packet Format - Device Specific Structure                            */
  169.  
  170.  
  171. /* Defines                                                                   */
  172. #define PEN_FUNC_QUSD 0x060       /*  Query Unit Specific Data               */
  173.  
  174. /* Values for pqusd.capabilities                                             */
  175. #define QUSD_RESEVERD 0x0000FFFF  /* reserved for architected use            */
  176. #define QUSD_OEM      0xFFFF0000  /* reserved for OEM use                    */
  177.  
  178. /* The following are defined for all device types                            */
  179. #define QUSD_LENGTH   0x00000001  /* first word of unit data is length       */
  180. #define QUSD_STANDARD 0x00000002  /* starts with standard device specific    */
  181.  
  182. /* The following are locator specific                                        */
  183. #define QUSD_X_INVERT 0x00000004  /* x raw coordinate is inverted            */
  184. #define QUSD_Y_INVERT 0x00000008  /* y raw coordinate is inverted            */
  185.  
  186. /* Values for pqusd.rc                                                       */
  187. #define QUSD_OK     0             /* all data copied                         */
  188. #define QUSD_TRUNC  1             /* data truncated                          */
  189. #define QUSD_NA     2             /* data is not available, none copied      */
  190.  
  191. /* standard locator unit specific data prefix                                */
  192. typedef struct _SLUSD        {    /* slusd */
  193.   ULONG   length;                 /* length of entire data area              */
  194.  
  195.   ULONG   XoriginDefault;         /* default x origin coordinate adjustment  */
  196.   ULONG   Xorigin;                /* x coordinate origin adjustment          */
  197.   ULONG   XmeasuredExtent;        /* mesaured x extent                       */
  198.  
  199.   ULONG   YoriginDefault;         /* default y origin coordinate adjustment  */
  200.   ULONG   Yorigin;                /* y coordinate origin adjustment          */
  201.   ULONG   YmeasuredExtent;        /* mesaured y extent                       */
  202. } SLUSD;
  203.  
  204. /**************************************************************************  */
  205. /* Category 90H - Function 61H: Query Unit Variable                          */
  206. /*                                                                           */
  207. /* This command gets the device specific variable from the requested unit.   */
  208. /* By convention, Unit 0, variable 0 returns an error counter. Unit 0,       */
  209. /* variable 1, returns a panic flag word.                                    */
  210.  
  211. /* Parameter Packet Format                                                   */
  212. typedef struct _P_QUV        {    /* pquv */
  213.   ULONG   unit;                   /* requested unit                          */
  214.   ULONG   index;                  /* index of variable to set                */
  215. } PQUV;
  216.  
  217. /* Data Packet Format - Device Specific Structure                            */
  218. typedef struct _D_QUV        {    /* dquv */
  219.   ULONG   value;                  /* value returned                          */
  220. } DQUV;
  221.  
  222. /* Defines                                                                   */
  223. #define PEN_FUNC_QUV 0x061        /* Query unit variable                     */
  224.  
  225. /* Panic values - return by unit 0, variable 1                               */
  226. /**************************************************************************  */
  227. /* Category 90H - Function 62H: Query Unit Capabilities                      */
  228. /*                                                                           */
  229. /* This command returns the capabilities for the unit.                       */
  230.  
  231. /* Parameter Packet Format                                                   */
  232. typedef struct _P_QUC        {    /* pquc */
  233.   ULONG   unit;                   /* requested unit                          */
  234.   ULONG   byteCount;              /* size in bytes of area to receive data   */
  235.   ULONG   RetByteCount;           /* bytes returned (output parm)            */
  236.   ULONG   rc;                     /* return code    (output parm)            */
  237. } PQUC;
  238.  
  239. /* Data Packet Format - area to receive extended information registration    */
  240. /* packet                                                                    */
  241.  
  242. /* Defines                                                                   */
  243. #define PEN_FUNC_QUC 0x062        /* Query unit capabilities                 */
  244.  
  245. /* Values for pquc.rc same as for spqusd.rc                                  */
  246.  
  247. /**************************************************************************  */
  248. /* Category 90H - Function 63H: Query Trace Table                            */
  249. /*                                                                           */
  250. /* This command returns the valid entries in the trace table. Each entry is  */
  251. /* double word (4 bytes) and can be considered an array of ULONGs. The first */
  252. /* entry has the number of valid entries to follow.                          */
  253.  
  254. /* Parameter Packet Format                                                   */
  255. typedef struct _P_QTT        {    /* pqtt  */
  256.   ULONG   size;                   /* Number of LONGs in allocated table      */
  257. } PQTT;
  258.  
  259. /* Data Packet Format - PLONG to trace table arrary                          */
  260.  
  261. /* Defines  - trace entry format                                             */
  262. #define PEN_FUNC_QTT 0x063        /* Query Trace Table                       */
  263.  
  264. /* Each entry has a trace code describing the contents of the entry          */
  265.  
  266. #define TRACE_MASK      0x0FF000000 /* isolate trace code from entry         */
  267. #define TRACE_MASK_SUB  0x0F0000000 /* isolate sub code value                */
  268.  
  269. #define TRACE_INT       0x0F0000000 /* interrupt event                       */
  270. #define TRACE_INT_H     0x0F000     /*                                       */
  271.  
  272. #define TRACE_TICK      0x0C0000000 /* timer tick, low word is tick count    */
  273. #define TRACE_TICK_H    0x0C000
  274.  
  275. #define TRACE_ABS       0x010000000 /* absolute packet sub trace code        */
  276. #define TRACE_ABS_E     0x01E000000 /* -- Mouse button event is low word     */
  277. #define TRACE_ABS_EH    0x01E00
  278. #define TRACE_ABS_X     0x011000000 /* -- x coordinate is low word           */
  279. #define TRACE_ABS_XH    0x01100
  280. #define TRACE_ABS_Y     0x012000000 /* -- y coordinate is low word           */
  281. #define TRACE_ABS_YH    0x01200
  282. #define TRACE_ABS_Z     0x014000000 /* -- z coordinate is low word           */
  283. #define TRACE_ABS_ZH    0x01400
  284. #define TRACE_ABS_D     0x015000000 /* -- EI device bits                     */
  285. #define TRACE_ABS_DH    0x01500
  286. #define TRACE_ABS_C     0x016000000 /* -- EI control word                    */
  287. #define TRACE_ABS_CH    0x01600
  288.  
  289. #define TRACE_ERROR     0x0E0000000 /* error trace, word is error count      */
  290. #define TRACE_ERROR_H   0x0E000
  291.  
  292. #define TRACE_DATA      0x000000000 /* raw data trace, byte is in low byte   */
  293. #define TRACE_DATA_1    0x001000000 /* -- 1st byte of a packet (optional)    */
  294. #define TRACE_DATA_1H   0x00100
  295. #define TRACE_DATA_H    0x00000     /* -- not 1st byte                       */
  296.  
  297. #define TRACE_SYS       0x020000000 /* System device Event (EMI only)        */
  298. #define TRACE_SYS_H     0x02000     /*                                       */
  299.  
  300. #define TRACE_BUTTON    0x0B0000000 /* button event sub trace code           */
  301. #define TRACE_BREL      0x0B0000000 /* button release mask is low word       */
  302. #define TRACE_BREL_H    0x0B000
  303. #define TRACE_BACT      0x0B1000000 /* button activation mask is low word    */
  304. #define TRACE_BACT_H    0x0B100
  305.  
  306. #define TRACE_DISPLAY   0x0D0000000 /* display event sub trace code          */
  307. #define TRACE_DOFF      0x0D0000000 /* display turned off                    */
  308. #define TRACE_DOFF_H    0x0D000
  309. #define TRACE_DON       0x0D1000000 /* display turned on                     */
  310. #define TRACE_DON_H     0x0D100
  311.  
  312. #define TRACE_DD        0x090000000 /* trace device dependent                */
  313.                                     /* low word is data, second byte is index*/
  314. #define TRACE_DD_H      0x09000
  315.  
  316. /**************************************************************************  */
  317. /* Category 90H - Function 64H: Query Trace Table Size                       */
  318. /*                                                                           */
  319. /* This command returns the size of the entire trace table. This function can*/
  320. /* be used to obtain the memory allocation size to be used for the Query     */
  321. /* Trace Table function.                                                     */
  322.  
  323. /* Parameter Packet Format - None                                            */
  324.  
  325. /* Data Packet Format                                                        */
  326. typedef struct _D_QTTS       {    /* dqtts */
  327.   ULONG   size;                   /* Number of LONG values in table          */
  328.                                   /*  (number of bytes / 4)                  */
  329. } DQTTS;
  330.  
  331. /* defines                                                                   */
  332. #define PEN_FUNC_QTTS 0x064       /* Query Trace Table Size                  */
  333.  
  334. /*****************************************************************************/
  335. /* Category 91H - Function 50H: Set Locator Offset                           */
  336. /*                                                                           */
  337. /* This function is used to change the digitizer finger offset.              */
  338. /* An offset may be negative. Both or either offsets can be changed          */
  339. /* occording to the functions ORed in the command field.                     */
  340.  
  341. /* Parameter Packet Format                                                   */
  342. typedef struct _P_SLO        {    /* pslo */
  343.   ULONG   unit;                   /* requested unit                          */
  344.   ULONG   command;                /* command                                 */
  345.   LONG    xOffset;                /* x offset in digitizer units             */
  346.   LONG    yOffset;                /* y offset in digitizer units             */
  347. } PSLO;
  348.  
  349. /* Data Packet Format - None                                                 */
  350.  
  351. /* Defines                                                                   */
  352. #define PEN_FUNC_SLO 0x050        /* Set Locator Offset                      */
  353.  
  354. /* Values for pslo.command                                                   */
  355. #define PSLO_SET_X     0x01       /* set x offset                            */
  356. #define PSLO_SET_Y     0x02       /* set y offset                            */
  357.  
  358. /*****************************************************************************/
  359. /* Category 91H - Function 51H: Set Locator Pass Rate                        */
  360. /*                                                                           */
  361. /* This function is used to change the OS/2 event rate.                      */
  362. /* If rate is equal to 2, then for every 2 digitizer                         */
  363. /* samples, only one is reported to the OS/2 PM as a mouse event. All samples*/
  364. /* are always reported to OS/2 Pen PM.                                       */
  365. /*                                                                           */
  366. /* If left at 0, Pen PM device driver services will calculate the pass rate  */
  367. /* automatically. This varible should be used only if the automatic value    */
  368. /* requires manual tuning.                                                   */
  369.  
  370. /* Parameter Packet Format                                                   */
  371. typedef struct _P_SLPR       {    /* pslpr */
  372.   ULONG   unit;                   /* requested unit                          */
  373.   ULONG   passRate;               /* number of ext events for each OS/2 event*/
  374. } PSLPR;
  375.  
  376. /* Data Packet Format - None                                                 */
  377.  
  378. /* Defines                                                                   */
  379. #define PEN_FUNC_SLPR 0x051       /* Set Locator Pass Rate                   */
  380.  
  381. /*****************************************************************************/
  382. /* Category 91H - Function 52H: Set Locator Sample Rate                      */
  383. /*                                                                           */
  384. /* This function is used to change the sample rate.                          */
  385. /* The device should round to the closest value.                             */
  386.  
  387. /* Parameter Packet Format                                                   */
  388. typedef struct _P_SLSR       {    /* pslsr */
  389.   ULONG   unit;                   /* requested unit                          */
  390.   ULONG   sampleRate;             /* sample rate in samples per second       */
  391. } PSLSR;
  392.  
  393. /* Data Packet Format - none                                                 */
  394.  
  395. /* Defines                                                                   */
  396. #define PEN_FUNC_SLSR 0x052       /* Set Locator Sample Rate                 */
  397.  
  398.  
  399. /*****************************************************************************/
  400. /* Category 91H - Function 60H: Query Locator Variables                      */
  401. /*                                                                           */
  402. /* This function returns the pen PM locator variables.                       */
  403.  
  404. /* Parameter Packet Format                                                   */
  405. typedef struct _P_QLV        {    /* pqlv  */
  406.   ULONG   unit;                   /* requested unit                          */
  407. } PQLV;
  408.  
  409. /* Data Packet Format                                                        */
  410. typedef struct _D_QLV        {    /* dqlv  */
  411.   LONG    xOffset;                /* x offset in digitizer units             */
  412.   LONG    yOffset;                /* y offset in digitizer units             */
  413.   ULONG   passRate;               /* pass rate                               */
  414.   ULONG   sampleRate;             /* sample rate in samples per second       */
  415. } DQLV;
  416.  
  417. /* Defines                                                                   */
  418. #define PEN_FUNC_QLV 0x060        /* Query Locator Variables                 */
  419.  
  420. /*****************************************************************************/
  421. /* Category 91H - Function 61H: Query Locator Raw Coordinate                 */
  422. /*                                                                           */
  423. /* This function returns the next valid raw locator coordinate. The dqlrc.rc */
  424. /* value reflects whether a coordinate value was available within specified  */
  425. /* timeout period.                                                           */
  426.  
  427. /* Parameter Packet Format                                                   */
  428. typedef struct _P_QLRC       {    /* pqlrc */
  429.   ULONG   unit;                   /* requested unit                          */
  430.   ULONG   timeout;                /* timeout value in milliseconds           */
  431. } PQLRC;
  432.  
  433. /* Data Packet Format                                                        */
  434. typedef struct _D_QLRC       {    /* dqlrc */
  435.   LONG    rc;                     /* return code                             */
  436.   LONG    xRaw;                   /* x in raw digitizer units                */
  437.   LONG    yRaw;                   /* y in raw digitizer units                */
  438. } DQLRC;
  439.  
  440. /* Defines                                                                   */
  441. #define PEN_FUNC_QLRC 0x061        /* Query Locator Raw Coordinate           */
  442.  
  443. /* Values for dqlrc.rc                                                       */
  444. #define QLRC_VALID     0           /* valid coordinates returned             */
  445. #define QLRC_TIMEOUT   1           /* timed out, coordinates are not valid   */
  446. #define QLRC_BUSY      2           /* only one thread at a time allowed      */
  447.  
  448. /*****************************************************************************/
  449. /*                                                                           */
  450. /* Category 91H - Function 62H: Set Button Assignment                        */
  451. /*                                                                           */
  452. /* This command returns the default locator extents                          */
  453. /*                                                                           */
  454. /*****************************************************************************/
  455.  
  456. typedef struct _P_QDLE {   /* pqdle */
  457.    ULONG    unit;          /* requested unit */
  458. } PQDLE;
  459.  
  460.  
  461. typedef struct _D_QDLE {   /* dqdle */
  462.    ULONG    rc;            /* return code */
  463.    ULONG    Xdefault;      /* X default extent */
  464.    ULONG    Ydefault;      /* Y default extent */
  465. } DQDLE;
  466.  
  467. #define  PEN_FUNC_QDLE  0x062
  468.  
  469. #define  QDLE_OK        0
  470. #define  QDLE_FAIL      1
  471.  
  472. /*****************************************************************************/
  473. /* Category 92H - Function 50H: Set Button Assignment                        */
  474. /*                                                                           */
  475. /* This command set the activation and release assignment for a button.      */
  476. /* the locator device selected.                                              */
  477.  
  478. /* Parameter Packet Format                                                   */
  479. typedef struct _P_SBA        {    /* psba  */
  480.   ULONG   unit;                   /* requested unit                          */
  481.   ULONG   buttonIndex;            /* index of button (0 to 15)               */
  482.   ULONG   action;                 /* action to preform                       */
  483.   ULONG   value;                  /* hotKey value for hot key assignment or  */
  484.                                   /* Mouse button selection mask             */
  485. } PSBA;
  486.  
  487. /* Data Packet Format - none                                                 */
  488.  
  489. /* Defines                                                                   */
  490. #define PEN_FUNC_SBA 0x050        /* Set Button Assignment                   */
  491.  
  492. /* Values for psba.action                                                    */
  493. /* NOTE: values MUST match order of capability fields in DCAP struct         */
  494. #define  NOBUTTONACTION     0     /* null - do nothing (the default)         */
  495. #define  SENDHOTKEY         1     /* send hot key; value in PSBA.hotKey      */
  496. #define  SHIFTBUTTON        2     /* set shift for button using mouseButtonMask */
  497. #define  APPLBUTTON         3     /* assign button for application use       */
  498. #define  AUGMENTATIONBUTTON 4     /* assign button for key augmentation      */
  499. #define  GESTUREMODE        5     /* assign button for gesturemode           */
  500.  
  501. /* Values for psba.value for action = ONETIMEBUTTON and SHIFTBUTTON          */
  502. #define  MOUSEBUTTON1     0x04    /* mouse button 1                          */
  503. #define  MOUSEBUTTON2     0x10    /* mouse button 2                          */
  504. #define  MOUSEBUTTON3     0x40    /* mouse button 3                          */
  505.  
  506. /* Value for psba.value for action = SENDHOTKEY                              */
  507. #define HOTKEY_CNTRL_ESC    1     /* do a CNTRL-ESC                          */
  508. #define HOTKEY_ALT_ESC      2     /* do an ALT-ESC                           */
  509.  
  510. /*****************************************************************************/
  511. /* Category 92H - Function 60H: Query Button Assignment                      */
  512. /*                                                                           */
  513. /* This command returns the assignment of a button                           */
  514.  
  515. /* Parameter Packet Format                                                   */
  516. typedef struct _P_QBA        {    /* pqba  */
  517.   ULONG   unit;                   /* requested unit                          */
  518.   ULONG   buttonIndex;            /* index of button (0 to 15)               */
  519. } PQBA;
  520.  
  521. /* Data Packet Format                                                        */
  522. typedef struct _D_QBA        {    /* dqba  */
  523.   ULONG   action;                 /* action to preform                       */
  524.   ULONG   value;                  /* hotKey value for hot key assignment or  */
  525.                                   /* Mouse button selection mask             */
  526. } DQBA;
  527.  
  528. /* Defines - same as Set Button Assignment                                   */
  529. #define PEN_FUNC_QBA 0x060        /* Query Button Assignment                 */
  530.  
  531. /*****************************************************************************/
  532. /* Category 93H - Function 50H: Set Display State                            */
  533. /*                                                                           */
  534. /* This command is used to turn the backlight either on or off. Turning on   */
  535. /* the backlight restarts the inactivity timer. The inactivity timer is only */
  536. /* used if automatic control is enabled.                                     */
  537.  
  538. /* Parameter Packet Format                                                   */
  539. typedef struct _P_SDS        {    /* psds  */
  540.   ULONG   unit;                   /* requested unit                          */
  541.   ULONG   command;                /* command to turn on or off               */
  542. } PSDS;
  543.  
  544. /* Data Packet Format - none                                                 */
  545.  
  546. /* Defines                                                                   */
  547. #define PEN_FUNC_SDS 0x050        /* Set Display State                       */
  548.  
  549. #define TURNBACKLIGHTON     1     /* value to turn backlight on              */
  550. #define TURNBACKLIGHTOFF    0     /* value to turn backlight off             */
  551.  
  552. /*****************************************************************************/
  553. /* Category 93H - Function 51H: Set Display Inactivity Period                */
  554. /*                                                                           */
  555. /* This IOCTL controls how the driver handles automatically turning on and   */
  556. /* off the display backlight. The following can be controlled:               */
  557. /*                                                                           */
  558. /* AutoEnable = (enable | disable)                                           */
  559. /*   When enabled, the backlight will be turned off after a peroid of no     */
  560. /*   user activity. User activity turns the backlight back on. User activity */
  561. /*   consists of input from any locator device, buttons, the OS/2 mouse, or  */
  562. /*   the keyboard.                                                           */
  563. /*                                                                           */
  564. /* Opaque   = (enable | disable)                                             */
  565. /*   When enabled, button actions and locator points from this driver are    */
  566. /*   processed even though the backlight is off. When disabled, button       */
  567. /*   actions are not processed and locator points are sent to the device     */
  568. /*   driver services, but are not processed by OS/2.                         */
  569. /*                                                                           */
  570. /* Suppress = (enable | disable)                                             */
  571. /*   When enabled, button down from the locator or mouse action that turned  */
  572. /*   the backlight on will be ignored and reported as a movement only.       */
  573. /*   Button actions will be ignored.                                         */
  574. /*                                                                           */
  575. /* Period = <seconds>                                                        */
  576. /*   The length of the inactivity period in seconds                          */
  577. /*                                                                           */
  578. /* All of these options are independent. All combination can be specified    */
  579. /* on a single IOCTL call. AutoEnable, Suppress, and Period are processed    */
  580. /* only if the display device capablities allow automatic backlight control. */
  581.  
  582. /* Parameter Packet Format                                                   */
  583. typedef struct _P_SDIP        {   /* psdip  */
  584.   ULONG   unit;                   /* requested unit                          */
  585.   ULONG   command;                /* command to turn enable and disable      */
  586.   ULONG   period;                 /* inactivity period in seconds            */
  587. } PSDIP;
  588.  
  589. /* Data Packet Format - none                                                 */
  590.  
  591. /* Defines                                                                   */
  592. #define PEN_FUNC_SDIP 0x051       /* Set Display Inactivity Period           */
  593.  
  594. /* psdip.command values                                                      */
  595. #define SDIP_PERIOD        0x01   /* change period value                     */
  596. #define SDIP_EN_AUTO       0x02   /* enable automatic inactivity period      */
  597. #define SDIP_DI_AUTO       0x04   /* disable automatic inactivity period     */
  598. #define SDIP_EN_OPAQUE     0x08   /* process events while backlight is off   */
  599. #define SDIP_DI_OPAQUE     0x10   /* ignore  events while backlight is off   */
  600. #define SDIP_EN_SUPPRESS   0x20   /* suppress after auto turn on             */
  601. #define SDIP_DI_SUPPRESS   0x40   /* don't suppress after auto turn on       */
  602.  
  603. /*****************************************************************************/
  604. /* Category 93H - Function 60H: Query Display State                          */
  605. /*                                                                           */
  606. /* This command returns whether the automatic inactivity period monitor is   */
  607. /* enabled or disabled.                                                      */
  608.  
  609. /* Parameter Packet Format                                                   */
  610. typedef struct _P_QDS        {    /* pqds                                    */
  611.   ULONG   unit;                   /* requested unit                          */
  612. } PQDS;
  613.  
  614. /* Data Packet Format                                                        */
  615. typedef struct _D_QDS        {    /* dqds  */
  616.   ULONG  state;                   /* state of backlight                      */
  617.   ULONG  automatic;               /* automatic options                       */
  618.   ULONG  period;                  /* inactivity period in seconds            */
  619. } DQDS;
  620.  
  621. /* Defines                                                                   */
  622. #define PEN_FUNC_QDS 0x060        /* Query Display State                     */
  623.  
  624. /* dqds.state uses same values as psdip.state                                */
  625. /* dqds.automatic uses same values as psdip.command                          */
  626.  
  627.