xtestext1const.inc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. (*
  2. * xtestext1.h
  3. *
  4. * X11 Input Synthesis Extension include file
  5. *)
  6. (*
  7. Copyright 1986, 1987, 1988, 1998 The Open Group
  8. Permission to use, copy, modify, distribute, and sell this software and its
  9. documentation for any purpose is hereby granted without fee, provided that
  10. the above copyright notice appear in all copies and that both that
  11. copyright notice and this permission notice appear in supporting
  12. documentation.
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  19. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. Except as contained in this notice, the name of The Open Group shall not be
  22. used in advertising or otherwise to promote the sale, use or other dealings
  23. in this Software without prior written authorization from The Open Group.
  24. Copyright 1986, 1987, 1988 by Hewlett-Packard Corporation
  25. Permission to use, copy, modify, and distribute this
  26. software and its documentation for any purpose and without
  27. fee is hereby granted, provided that the above copyright
  28. notice appear in all copies and that both that copyright
  29. notice and this permission notice appear in supporting
  30. documentation, and that the name of Hewlett-Packard not be used in
  31. advertising or publicity pertaining to distribution of the
  32. software without specific, written prior permission.
  33. Hewlett-Packard makes no representations about the
  34. suitability of this software for any purpose. It is provided
  35. "as is" without express or implied warranty.
  36. This software is not subject to any license of the American
  37. Telephone and Telegraph Company or of the Regents of the
  38. University of California.
  39. *)
  40. const
  41. XTestMAX_ACTION_LIST_SIZE = 64;
  42. XTestACTIONS_SIZE = 28;
  43. (*
  44. * used in the XTestPressButton and XTestPressKey functions
  45. *)
  46. XTestPRESS = 1 shl 0;
  47. XTestRELEASE = 1 shl 1;
  48. XTestSTROKE = 1 shl 2;
  49. (*
  50. * When doing a key or button stroke, the number of milliseconds
  51. * to delay between the press and the release of a key or button
  52. * in the XTestPressButton and XTestPressKey functions.
  53. *)
  54. XTestSTROKE_DELAY_TIME = 10;
  55. (*
  56. * used in the XTestGetInput function
  57. *)
  58. XTestEXCLUSIVE = 1 shl 0;
  59. XTestPACKED_ACTIONS = 1 shl 1;
  60. XTestPACKED_MOTION = 1 shl 2;
  61. (*
  62. * used in the XTestFakeInput function
  63. *)
  64. XTestFAKE_ACK_NOT_NEEDED = 0;
  65. XTestFAKE_ACK_REQUEST = 1;
  66. (*
  67. * used in the XTest extension initialization routine
  68. *)
  69. XTestEXTENSION_NAME = 'XTestExtension1';
  70. XTestEVENT_COUNT = 2;
  71. (*
  72. * This is the definition for the format of the header byte
  73. * in the input action structures.
  74. *)
  75. XTestACTION_TYPE_MASK = $03; { bits 0 and 1 }
  76. XTestKEY_STATE_MASK = $04; { bit 2 (key action) }
  77. XTestX_SIGN_BIT_MASK = $04; { bit 2 (motion action) }
  78. XTestY_SIGN_BIT_MASK = $08; { bit 3 (motion action) }
  79. XTestDEVICE_ID_MASK = $f0; { bits 4 through 7 }
  80. XTestMAX_DEVICE_ID = $0f;
  81. //#define XTestPackDeviceID(x) (((x) & XTestMAX_DEVICE_ID) << 4)
  82. //#define XTestUnpackDeviceID(x) (((x) & XTestDEVICE_ID_MASK) >> 4)
  83. (*
  84. * These are the possible action types.
  85. *)
  86. XTestDELAY_ACTION = 0;
  87. XTestKEY_ACTION = 1;
  88. XTestMOTION_ACTION = 2;
  89. XTestJUMP_ACTION = 3;
  90. (*
  91. * These are the definitions for key/button motion input actions.
  92. *)
  93. XTestKEY_UP = $04;
  94. XTestKEY_DOWN = $00;
  95. (*
  96. * These are the definitions for pointer relative motion input
  97. * actions.
  98. *
  99. * The sign bits for the x and y relative motions are contained
  100. * in the header byte. The x and y relative motions are packed
  101. * into one byte to make things fit in 32 bits. If the relative
  102. * motion range is larger than +/-15, use the pointer jump action.
  103. *)
  104. XTestMOTION_MAX = 15;
  105. XTestMOTION_MIN = -15;
  106. XTestX_NEGATIVE = $04;
  107. XTestY_NEGATIVE = $08;
  108. XTestX_MOTION_MASK = $0f;
  109. XTestY_MOTION_MASK = $f0;
  110. //#define XTestPackXMotionValue(x) ((x) & XTestX_MOTION_MASK)
  111. //#define XTestPackYMotionValue(x) (((x) << 4) & XTestY_MOTION_MASK)
  112. //#define XTestUnpackXMotionValue(x) ((x) & XTestX_MOTION_MASK)
  113. //#define XTestUnpackYMotionValue(x) (((x) & XTestY_MOTION_MASK) >> 4)
  114. (*
  115. * These are the definitions for a long delay input action. It is
  116. * used when more than XTestSHORT_DELAY_TIME milliseconds of delay
  117. * (approximately one minute) is needed.
  118. *
  119. * The device ID for a delay is always set to XTestDELAY_DEVICE_ID.
  120. * This guarantees that a header byte with a value of 0 is not
  121. * a valid header, so it can be used as a flag to indicate that
  122. * there are no more input actions in an XTestInputAction event.
  123. *)
  124. XTestSHORT_DELAY_TIME = $ffff;
  125. XTestDELAY_DEVICE_ID = $0f;