XKB.h
上传用户:lctgjx
上传日期:2022-06-04
资源大小:8887k
文件大小:28k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /* $Xorg: XKB.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
  2. /************************************************************
  3. Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  4. Permission to use, copy, modify, and distribute this
  5. software and its documentation for any purpose and without
  6. fee is hereby granted, provided that the above copyright
  7. notice appear in all copies and that both that copyright
  8. notice and this permission notice appear in supporting
  9. documentation, and that the name of Silicon Graphics not be 
  10. used in advertising or publicity pertaining to distribution 
  11. of the software without specific prior written permission.
  12. Silicon Graphics makes no representation about the suitability 
  13. of this software for any purpose. It is provided "as is"
  14. without any express or implied warranty.
  15. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  16. SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  17. AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  18. GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  19. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  20. DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  21. OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  22. THE USE OR PERFORMANCE OF THIS SOFTWARE.
  23. ********************************************************/
  24. /* $XFree86: xc/include/extensions/XKB.h,v 1.5tsi Exp $ */
  25. #ifndef _XKB_H_
  26. #define _XKB_H_
  27.     /*
  28.      * XKB request codes, used in:
  29.      *  -  xkbReqType field of all requests
  30.      *  -  requestMinor field of some events
  31.      */
  32. #define X_kbUseExtension  0
  33. #define X_kbSelectEvents    1
  34. #define X_kbBell  3
  35. #define X_kbGetState  4
  36. #define X_kbLatchLockState  5
  37. #define X_kbGetControls  6
  38. #define X_kbSetControls  7
  39. #define X_kbGetMap  8
  40. #define X_kbSetMap  9
  41. #define X_kbGetCompatMap 10
  42. #define X_kbSetCompatMap 11
  43. #define X_kbGetIndicatorState 12
  44. #define X_kbGetIndicatorMap 13
  45. #define X_kbSetIndicatorMap 14
  46. #define X_kbGetNamedIndicator 15
  47. #define X_kbSetNamedIndicator 16
  48. #define X_kbGetNames 17
  49. #define X_kbSetNames 18
  50. #define X_kbGetGeometry 19
  51. #define X_kbSetGeometry 20
  52. #define X_kbPerClientFlags 21
  53. #define X_kbListComponents 22
  54. #define X_kbGetKbdByName 23
  55. #define X_kbGetDeviceInfo 24
  56. #define X_kbSetDeviceInfo 25
  57. #define X_kbSetDebuggingFlags 101
  58.     /*
  59.      * In the X sense, XKB reports only one event.
  60.      * The type field of all XKB events is XkbEventCode
  61.      */
  62. #define XkbEventCode 0
  63. #define XkbNumberEvents (XkbEventCode+1)
  64.     /*
  65.      * XKB has a minor event code so it can use one X event code for 
  66.      * multiple purposes.  
  67.      *  - reported in the xkbType field of all XKB events.
  68.      *  - XkbSelectEventDetails: Indicates the event for which event details 
  69.      *    are being changed
  70.      */
  71. #define XkbNewKeyboardNotify 0
  72. #define XkbMapNotify 1
  73. #define XkbStateNotify 2
  74. #define XkbControlsNotify 3
  75. #define XkbIndicatorStateNotify 4
  76. #define XkbIndicatorMapNotify 5
  77. #define XkbNamesNotify 6
  78. #define XkbCompatMapNotify 7
  79. #define XkbBellNotify 8
  80. #define XkbActionMessage 9
  81. #define XkbAccessXNotify 10
  82. #define XkbExtensionDeviceNotify 11
  83.     /*
  84.      * Event Mask:
  85.      *  - XkbSelectEvents:  Specifies event interest.
  86.      */
  87. #define XkbNewKeyboardNotifyMask (1L << 0)
  88. #define XkbMapNotifyMask (1L << 1)
  89. #define XkbStateNotifyMask (1L << 2)
  90. #define XkbControlsNotifyMask (1L << 3)
  91. #define XkbIndicatorStateNotifyMask (1L << 4)
  92. #define XkbIndicatorMapNotifyMask (1L << 5)
  93. #define XkbNamesNotifyMask (1L << 6)
  94. #define XkbCompatMapNotifyMask (1L << 7)
  95. #define XkbBellNotifyMask (1L << 8)
  96. #define XkbActionMessageMask (1L << 9)
  97. #define XkbAccessXNotifyMask (1L << 10)
  98. #define XkbExtensionDeviceNotifyMask (1L << 11)
  99. #define XkbAllEventsMask (0xFFF)
  100.     /*
  101.      * NewKeyboardNotify event details:
  102.      */
  103. #define XkbNKN_KeycodesMask (1L << 0)
  104. #define XkbNKN_GeometryMask (1L << 1)
  105. #define XkbNKN_DeviceIDMask (1L << 2)
  106. #define XkbAllNewKeyboardEventsMask (0x7)
  107.     /*
  108.      * AccessXNotify event types:
  109.      *  - The 'what' field of AccessXNotify events reports the
  110.      *    reason that the event was generated.
  111.      */
  112. #define XkbAXN_SKPress 0
  113. #define XkbAXN_SKAccept 1
  114. #define XkbAXN_SKReject 2
  115. #define XkbAXN_SKRelease 3
  116. #define XkbAXN_BKAccept 4
  117. #define XkbAXN_BKReject 5
  118. #define XkbAXN_AXKWarning 6
  119.     /*
  120.      * AccessXNotify details:
  121.      * - Used as an event detail mask to limit the conditions under which
  122.      *   AccessXNotify events are reported
  123.      */
  124. #define XkbAXN_SKPressMask (1L << 0)
  125. #define XkbAXN_SKAcceptMask (1L << 1)
  126. #define XkbAXN_SKRejectMask (1L << 2)
  127. #define XkbAXN_SKReleaseMask (1L << 3)
  128. #define XkbAXN_BKAcceptMask (1L << 4)
  129. #define XkbAXN_BKRejectMask (1L << 5)
  130. #define XkbAXN_AXKWarningMask (1L << 6)
  131. #define XkbAllAccessXEventsMask (0xf)
  132.     /*
  133.      * Miscellaneous event details:
  134.      * - event detail masks for assorted events that don't reall
  135.      *   have any details.
  136.      */
  137. #define XkbAllStateEventsMask XkbAllStateComponentsMask
  138. #define XkbAllMapEventsMask XkbAllMapComponentsMask
  139. #define XkbAllControlEventsMask XkbAllControlsMask
  140. #define XkbAllIndicatorEventsMask XkbAllIndicatorsMask
  141. #define XkbAllNameEventsMask XkbAllNamesMask
  142. #define XkbAllCompatMapEventsMask XkbAllCompatMask
  143. #define XkbAllBellEventsMask (1L << 0)
  144. #define XkbAllActionMessagesMask (1L << 0)
  145.     /*
  146.      * XKB reports one error:  BadKeyboard
  147.      * A further reason for the error is encoded into to most significant
  148.      * byte of the resourceID for the error:
  149.      *    XkbErr_BadDevice - the device in question was not found
  150.      *    XkbErr_BadClass  - the device was found but it doesn't belong to 
  151.      *                       the appropriate class.
  152.      *    XkbErr_BadId     - the device was found and belongs to the right
  153.      *                       class, but not feedback with a matching id was
  154.      *                       found.
  155.      * The low byte of the resourceID for this error contains the device
  156.      * id, class specifier or feedback id that failed.
  157.      */
  158. #define XkbKeyboard 0
  159. #define XkbNumberErrors 1
  160. #define XkbErr_BadDevice 0xff
  161. #define XkbErr_BadClass 0xfe
  162. #define XkbErr_BadId 0xfd
  163.     /*
  164.      * Keyboard Components Mask:
  165.      * - Specifies the components that follow a GetKeyboardByNameReply
  166.      */
  167. #define XkbClientMapMask (1L << 0)
  168. #define XkbServerMapMask (1L << 1)
  169. #define XkbCompatMapMask (1L << 2)
  170. #define XkbIndicatorMapMask (1L << 3)
  171. #define XkbNamesMask (1L << 4)
  172. #define XkbGeometryMask (1L << 5)
  173. #define XkbControlsMask (1L << 6)
  174. #define XkbAllComponentsMask (0x7f)
  175.     /*
  176.      * State detail mask:
  177.      *  - The 'changed' field of StateNotify events reports which of
  178.      *    the keyboard state components have changed.
  179.      *  - Used as an event detail mask to limit the conditions under
  180.      *    which StateNotify events are reported.
  181.      */
  182. #define XkbModifierStateMask (1L << 0)
  183. #define XkbModifierBaseMask (1L << 1)
  184. #define XkbModifierLatchMask (1L << 2)
  185. #define XkbModifierLockMask (1L << 3)
  186. #define XkbGroupStateMask (1L << 4)
  187. #define XkbGroupBaseMask (1L << 5)
  188. #define XkbGroupLatchMask (1L << 6)
  189. #define XkbGroupLockMask (1L << 7)
  190. #define XkbCompatStateMask (1L << 8)
  191. #define XkbGrabModsMask (1L << 9)
  192. #define XkbCompatGrabModsMask (1L << 10)
  193. #define XkbLookupModsMask (1L << 11)
  194. #define XkbCompatLookupModsMask (1L << 12)
  195. #define XkbPointerButtonMask (1L << 13)
  196. #define XkbAllStateComponentsMask (0x3fff)
  197.     /*
  198.      * Controls detail masks:
  199.      *  The controls specified in XkbAllControlsMask:
  200.      *  - The 'changed' field of ControlsNotify events reports which of 
  201.      *    the keyboard controls have changed.
  202.      *  - The 'changeControls' field of the SetControls request specifies
  203.      *    the controls for which values are to be changed.
  204.      *  - Used as an event detail mask to limit the conditions under 
  205.      *    which ControlsNotify events are reported.
  206.      *
  207.      *  The controls specified in the XkbAllBooleanCtrlsMask:
  208.      *  - The 'enabledControls' field of ControlsNotify events reports the
  209.      *    current status of the boolean controls.
  210.      *  - The 'enabledControlsChanges' field of ControlsNotify events reports
  211.      *    any boolean controls that have been turned on or off.
  212.      *  - The 'affectEnabledControls' and 'enabledControls' fields of the
  213.      *    kbSetControls request change the set of enabled controls.
  214.      *  - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of
  215.      *    an XkbControlsRec specify the controls to be changed if the keyboard
  216.      *    times out and the values to which they should be changed.
  217.      *  - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags 
  218.      *    request specifies the specify the controls to be reset when the
  219.      *    client exits and the values to which they should be reset.
  220.      *  - The 'ctrls' field of an indicator map specifies the controls
  221.      *    that drive the indicator.
  222.      *  - Specifies the boolean controls affected by the SetControls and
  223.      *    LockControls key actions.
  224.      */
  225. #define XkbRepeatKeysMask  (1L << 0)
  226. #define XkbSlowKeysMask  (1L << 1)
  227. #define XkbBounceKeysMask  (1L << 2)
  228. #define XkbStickyKeysMask  (1L << 3)
  229. #define XkbMouseKeysMask  (1L << 4)
  230. #define XkbMouseKeysAccelMask  (1L << 5)
  231. #define XkbAccessXKeysMask  (1L << 6)
  232. #define XkbAccessXTimeoutMask  (1L << 7)
  233. #define XkbAccessXFeedbackMask  (1L << 8)
  234. #define XkbAudibleBellMask  (1L << 9)
  235. #define XkbOverlay1Mask  (1L << 10)
  236. #define XkbOverlay2Mask  (1L << 11)
  237. #define XkbIgnoreGroupLockMask  (1L << 12)
  238. #define XkbGroupsWrapMask  (1L << 27)
  239. #define XkbInternalModsMask  (1L << 28)
  240. #define XkbIgnoreLockModsMask  (1L << 29)
  241. #define XkbPerKeyRepeatMask  (1L << 30)
  242. #define XkbControlsEnabledMask  (1L << 31)
  243. #define XkbAccessXOptionsMask    (XkbStickyKeysMask|XkbAccessXFeedbackMask)
  244. #define XkbAllBooleanCtrlsMask  (0x00001FFF)
  245. #define XkbAllControlsMask  (0xF8001FFF)
  246. #define XkbAllControlEventsMask  XkbAllControlsMask
  247.     /*
  248.      * AccessX Options Mask
  249.      *  - The 'accessXOptions' field of an XkbControlsRec specifies the
  250.      *    AccessX options that are currently in effect.
  251.      *  - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues'
  252.      *    fields of an XkbControlsRec specify the Access X options to be 
  253.      *    changed if the keyboard times out and the values to which they 
  254.      *    should be changed.
  255.      */
  256. #define XkbAX_SKPressFBMask (1L << 0)
  257. #define XkbAX_SKAcceptFBMask (1L << 1)
  258. #define XkbAX_FeatureFBMask (1L << 2)
  259. #define XkbAX_SlowWarnFBMask (1L << 3)
  260. #define XkbAX_IndicatorFBMask (1L << 4)
  261. #define XkbAX_StickyKeysFBMask (1L << 5)
  262. #define XkbAX_TwoKeysMask (1L << 6)
  263. #define XkbAX_LatchToLockMask (1L << 7)
  264. #define XkbAX_SKReleaseFBMask (1L << 8)
  265. #define XkbAX_SKRejectFBMask (1L << 9)
  266. #define XkbAX_BKRejectFBMask (1L << 10)
  267. #define XkbAX_DumbBellFBMask (1L << 11)
  268. #define XkbAX_FBOptionsMask (0xF3F)
  269. #define XkbAX_SKOptionsMask (0x0C0)
  270. #define XkbAX_AllOptionsMask (0xFFF)
  271.     /*
  272.      * XkbUseCoreKbd is used to specify the core keyboard without having
  273.      *  to look up its X input extension identifier.
  274.      * XkbUseCorePtr is used to specify the core pointer without having
  275.      * to look up its X input extension identifier.
  276.      * XkbDfltXIClass is used to specify "don't care" any place that the
  277.      * XKB protocol is looking for an X Input Extension 
  278.      * device class.
  279.      * XkbDfltXIId is used to specify "don't care" any place that the
  280.      * XKB protocol is looking for an X Input Extension
  281.      * feedback identifier.
  282.      * XkbAllXIClasses is used to get information about all device indicators,
  283.      * whether they're part of the indicator feedback class
  284.      * or the keyboard feedback class.
  285.      * XkbAllXIIds is used to get information about all device indicator
  286.      * feedbacks without having to list them.
  287.      * XkbXINone is used to indicate that no class or id has been specified.
  288.      * XkbLegalXILedClass(c)  True if 'c' specifies a legal class with LEDs
  289.      * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells
  290.      * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device
  291.      * XkbExplicitXIClass(c)  True if 'c' explicitly specifies a device class
  292.      * XkbExplicitXIId(c)     True if 'i' explicitly specifies a device id
  293.      * XkbSingleXIClass(c)    True if 'c' specifies exactly one device class, 
  294.      *                        including the default.
  295.      * XkbSingleXIId(i)       True if 'i' specifies exactly one device 
  296.      *                       identifier, including the default.
  297.      */
  298. #define XkbUseCoreKbd 0x0100
  299. #define XkbUseCorePtr 0x0200
  300. #define XkbDfltXIClass 0x0300
  301. #define XkbDfltXIId 0x0400
  302. #define XkbAllXIClasses 0x0500
  303. #define XkbAllXIIds 0x0600
  304. #define XkbXINone 0xff00
  305. #define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||
  306. ((c)==LedFeedbackClass)||
  307. ((c)==XkbDfltXIClass)||
  308. ((c)==XkbAllXIClasses))
  309. #define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||
  310. ((c)==BellFeedbackClass)||
  311. ((c)==XkbDfltXIClass)||
  312. ((c)==XkbAllXIClasses))
  313. #define XkbExplicitXIDevice(c) (((c)&(~0xff))==0)
  314. #define XkbExplicitXIClass(c) (((c)&(~0xff))==0)
  315. #define XkbExplicitXIId(c) (((c)&(~0xff))==0)
  316. #define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass))
  317. #define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId))
  318. #define XkbNoModifier 0xff
  319. #define XkbNoShiftLevel 0xff
  320. #define XkbNoShape 0xff
  321. #define XkbNoIndicator 0xff
  322. #define XkbNoModifierMask 0
  323. #define XkbAllModifiersMask 0xff
  324. #define XkbAllVirtualModsMask 0xffff
  325. #define XkbNumKbdGroups 4
  326. #define XkbMaxKbdGroup (XkbNumKbdGroups-1)
  327. #define XkbMaxMouseKeysBtn 4
  328.     /*
  329.      * Group Index and Mask:
  330.      *  - Indices into the kt_index array of a key type.
  331.      *  - Mask specifies types to be changed for XkbChangeTypesOfKey
  332.      */
  333. #define XkbGroup1Index 0
  334. #define XkbGroup2Index 1
  335. #define XkbGroup3Index 2
  336. #define XkbGroup4Index 3
  337. #define XkbAnyGroup 254
  338. #define XkbAllGroups 255
  339. #define XkbGroup1Mask (1<<0)
  340. #define XkbGroup2Mask (1<<1)
  341. #define XkbGroup3Mask (1<<2)
  342. #define XkbGroup4Mask (1<<3)
  343. #define XkbAnyGroupMask (1<<7)
  344. #define XkbAllGroupsMask (0xf)
  345.     /*
  346.      * BuildCoreState: Given a keyboard group and a modifier state,
  347.      *                 construct the value to be reported an event.
  348.      * GroupForCoreState:  Given the state reported in an event,
  349.      *                 determine the keyboard group.
  350.      * IsLegalGroup:   Returns TRUE if 'g' is a valid group index.
  351.      */
  352. #define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff))
  353. #define XkbGroupForCoreState(s) (((s)>>13)&0x3)
  354. #define XkbIsLegalGroup(g) (((g)>=0)&&((g)<XkbNumKbdGroups))
  355.     /*
  356.      * GroupsWrap values:
  357.      *  - The 'groupsWrap' field of an XkbControlsRec specifies the
  358.      *    treatment of out of range groups.
  359.      *  - Bits 6 and 7 of the group info field of a key symbol map
  360.      *    specify the interpretation of out of range groups for the
  361.      *    corresponding key.
  362.      */
  363. #define XkbWrapIntoRange (0x00)
  364. #define XkbClampIntoRange (0x40)
  365. #define XkbRedirectIntoRange (0x80)
  366.     /*
  367.      * Action flags:  Reported in the 'flags' field of most key actions.
  368.      * Interpretation depends on the type of the action; not all actions
  369.      * accept all flags.
  370.      *
  371.      * Option Used for Actions
  372.      * ------ ----------------
  373.      * ClearLocks SetMods, LatchMods, SetGroup, LatchGroup
  374.      * LatchToLock SetMods, LatchMods, SetGroup, LatchGroup
  375.      * LockNoLock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
  376.      * LockNoUnlock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
  377.      * UseModMapMods SetMods, LatchMods, LockMods, ISOLock
  378.      * GroupAbsolute SetGroup, LatchGroup, LockGroup, ISOLock
  379.      * UseDfltButton PtrBtn, LockPtrBtn
  380.      * NoAcceleration MovePtr
  381.      * MoveAbsoluteX MovePtr
  382.      * MoveAbsoluteY MovePtr
  383.      * ISODfltIsGroup ISOLock
  384.      * ISONoAffectMods ISOLock
  385.      * ISONoAffectGroup ISOLock
  386.      * ISONoAffectPtr ISOLock
  387.      * ISONoAffectCtrls ISOLock
  388.      * MessageOnPress ActionMessage
  389.      * MessageOnRelease ActionMessage
  390.      * MessageGenKeyEvent ActionMessage
  391.      * AffectDfltBtn SetPtrDflt
  392.      * DfltBtnAbsolute SetPtrDflt
  393.      * SwitchApplication SwitchScreen
  394.      * SwitchAbsolute SwitchScreen
  395.      */
  396. #define XkbSA_ClearLocks (1L << 0)
  397. #define XkbSA_LatchToLock (1L << 1)
  398. #define XkbSA_LockNoLock (1L << 0)
  399. #define XkbSA_LockNoUnlock (1L << 1)
  400. #define XkbSA_UseModMapMods (1L << 2)
  401. #define XkbSA_GroupAbsolute (1L << 2)
  402. #define XkbSA_UseDfltButton 0
  403. #define XkbSA_NoAcceleration (1L << 0)
  404. #define XkbSA_MoveAbsoluteX (1L << 1)
  405. #define XkbSA_MoveAbsoluteY (1L << 2)
  406. #define XkbSA_ISODfltIsGroup   (1L << 7)
  407. #define XkbSA_ISONoAffectMods  (1L << 6)
  408. #define XkbSA_ISONoAffectGroup  (1L << 5)
  409. #define XkbSA_ISONoAffectPtr  (1L << 4)
  410. #define XkbSA_ISONoAffectCtrls  (1L << 3)
  411. #define XkbSA_ISOAffectMask  (0x78)
  412. #define XkbSA_MessageOnPress  (1L << 0)
  413. #define XkbSA_MessageOnRelease  (1L << 1)
  414. #define XkbSA_MessageGenKeyEvent (1L << 2)
  415. #define XkbSA_AffectDfltBtn 1
  416. #define XkbSA_DfltBtnAbsolute (1L << 2)
  417. #define XkbSA_SwitchApplication (1L << 0)
  418. #define XkbSA_SwitchAbsolute (1L << 2)
  419.     /*
  420.      * The following values apply to the SA_DeviceValuator 
  421.      * action only.  Valuator operations specify the action 
  422.      * to be taken.   Values specified in the action are 
  423.      * multiplied by 2^scale before they are applied.
  424.      */
  425. #define XkbSA_IgnoreVal (0x00)
  426. #define XkbSA_SetValMin (0x10)
  427. #define XkbSA_SetValCenter (0x20)
  428. #define XkbSA_SetValMax (0x30)
  429. #define XkbSA_SetValRelative (0x40)
  430. #define XkbSA_SetValAbsolute (0x50)
  431. #define XkbSA_ValOpMask (0x70)
  432. #define XkbSA_ValScaleMask (0x07)
  433. #define XkbSA_ValOp(a) ((a)&XkbSA_ValOpMask)
  434. #define XkbSA_ValScale(a) ((a)&XkbSA_ValScaleMask)
  435.     /*
  436.      * Action types: specifies the type of a key action.  Reported in the
  437.      * type field of all key actions.
  438.      */
  439. #define XkbSA_NoAction 0x00
  440. #define XkbSA_SetMods 0x01
  441. #define XkbSA_LatchMods 0x02
  442. #define XkbSA_LockMods 0x03
  443. #define XkbSA_SetGroup 0x04
  444. #define XkbSA_LatchGroup 0x05
  445. #define XkbSA_LockGroup 0x06
  446. #define XkbSA_MovePtr 0x07
  447. #define XkbSA_PtrBtn 0x08
  448. #define XkbSA_LockPtrBtn 0x09
  449. #define XkbSA_SetPtrDflt 0x0a
  450. #define XkbSA_ISOLock 0x0b
  451. #define XkbSA_Terminate 0x0c
  452. #define XkbSA_SwitchScreen 0x0d
  453. #define XkbSA_SetControls 0x0e
  454. #define XkbSA_LockControls 0x0f
  455. #define XkbSA_ActionMessage 0x10
  456. #define XkbSA_RedirectKey 0x11
  457. #define XkbSA_DeviceBtn 0x12
  458. #define XkbSA_LockDeviceBtn 0x13
  459. #define XkbSA_DeviceValuator 0x14
  460. #define XkbSA_LastAction XkbSA_DeviceValuator
  461. #define XkbSA_NumActions (XkbSA_LastAction+1)
  462. #define XkbSA_XFree86Private 0x86
  463.     /*
  464.      * Specifies the key actions that clear latched groups or modifiers.
  465.      */
  466. #define XkbSA_BreakLatch 
  467. ((1<<XkbSA_NoAction)|(1<<XkbSA_PtrBtn)|(1<<XkbSA_LockPtrBtn)|
  468. (1<<XkbSA_Terminate)|(1<<XkbSA_SwitchScreen)|(1<<XkbSA_SetControls)|
  469. (1<<XkbSA_LockControls)|(1<<XkbSA_ActionMessage)|
  470. (1<<XkbSA_RedirectKey)|(1<<XkbSA_DeviceBtn)|(1<<XkbSA_LockDeviceBtn))
  471.  
  472.     /*
  473.      * Macros to classify key actions
  474.      */
  475. #define XkbIsModAction(a) (((a)->type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods))
  476. #define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup))
  477. #define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt))
  478.     /*
  479.      * Key Behavior Qualifier:
  480.      *    KB_Permanent indicates that the behavior describes an unalterable
  481.      *    characteristic of the keyboard, not an XKB software-simulation of
  482.      *    the listed behavior.
  483.      * Key Behavior Types:  
  484.      *    Specifies the behavior of the underlying key.
  485.      */
  486. #define XkbKB_Permanent 0x80
  487. #define XkbKB_OpMask 0x7f
  488. #define XkbKB_Default 0x00
  489. #define XkbKB_Lock 0x01
  490. #define XkbKB_RadioGroup 0x02
  491. #define XkbKB_Overlay1 0x03
  492. #define XkbKB_Overlay2 0x04
  493. #define XkbKB_RGAllowNone 0x80
  494.     /*
  495.      * Various macros which describe the range of legal keycodes.
  496.      */
  497. #define XkbMinLegalKeyCode 8
  498. #define XkbMaxLegalKeyCode 255
  499. #define XkbMaxKeyCount (XkbMaxLegalKeyCode-XkbMinLegalKeyCode+1)
  500. #define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8)
  501. /* Seems kinda silly to check that an unsigned char is <= 255... */
  502. #define XkbIsLegalKeycode(k) ((k)>=XkbMinLegalKeyCode)
  503.     /*
  504.      * Assorted constants and limits.
  505.      */
  506. #define XkbNumModifiers 8
  507. #define XkbNumVirtualMods 16
  508. #define XkbNumIndicators 32
  509. #define XkbAllIndicatorsMask (0xffffffff)
  510. #define XkbMaxRadioGroups 32
  511. #define XkbAllRadioGroupsMask (0xffffffff)
  512. #define XkbMaxShiftLevel 63
  513. #define XkbMaxSymsPerKey (XkbMaxShiftLevel*XkbNumKbdGroups)
  514. #define XkbRGMaxMembers 12
  515. #define XkbActionMessageLength 6
  516. #define XkbKeyNameLength 4
  517. #define XkbMaxRedirectCount 8
  518. #define XkbGeomPtsPerMM 10
  519. #define XkbGeomMaxColors 32
  520. #define XkbGeomMaxLabelColors 3
  521. #define XkbGeomMaxPriority 255
  522.     /*
  523.      * Key Type index and mask for the four standard key types.
  524.      */
  525. #define XkbOneLevelIndex 0
  526. #define XkbTwoLevelIndex 1
  527. #define XkbAlphabeticIndex 2
  528. #define XkbKeypadIndex 3
  529. #define XkbLastRequiredType XkbKeypadIndex
  530. #define XkbNumRequiredTypes (XkbLastRequiredType+1)
  531. #define XkbMaxKeyTypes 255
  532. #define XkbOneLevelMask (1<<0)
  533. #define XkbTwoLevelMask (1<<1)
  534. #define XkbAlphabeticMask (1<<2)
  535. #define XkbKeypadMask (1<<3)
  536. #define XkbAllRequiredTypes (0xf)
  537. #define XkbShiftLevel(n) ((n)-1)
  538. #define XkbShiftLevelMask(n) (1<<((n)-1))
  539.     /*
  540.      * Extension name and version information
  541.      */
  542. #define XkbName "XKEYBOARD"
  543. #define XkbMajorVersion 1
  544. #define XkbMinorVersion 0
  545.     /*
  546.      * Explicit map components:
  547.      *  - Used in the 'explicit' field of an XkbServerMap.  Specifies
  548.      *    the keyboard components that should _not_ be updated automatically
  549.      *    in response to core protocol keyboard mapping requests.
  550.      */
  551. #define XkbExplicitKeyTypesMask   (0x0f)
  552. #define XkbExplicitKeyType1Mask   (1<<0)
  553. #define XkbExplicitKeyType2Mask   (1<<1)
  554. #define XkbExplicitKeyType3Mask   (1<<2)
  555. #define XkbExplicitKeyType4Mask   (1<<3)
  556. #define XkbExplicitInterpretMask  (1<<4)
  557. #define XkbExplicitAutoRepeatMask (1<<5)
  558. #define XkbExplicitBehaviorMask   (1<<6)
  559. #define XkbExplicitVModMapMask   (1<<7)
  560. #define XkbAllExplicitMask   (0xff)
  561.     /*
  562.      * Map components masks:
  563.      * Those in AllMapComponentsMask:
  564.      *  - Specifies the individual fields to be loaded or changed for the
  565.      *    GetMap and SetMap requests.
  566.      * Those in ClientInfoMask:
  567.      *  - Specifies the components to be allocated by XkbAllocClientMap.
  568.      * Those in ServerInfoMask:
  569.      *  - Specifies the components to be allocated by XkbAllocServerMap.
  570.      */
  571. #define XkbKeyTypesMask (1<<0)
  572. #define XkbKeySymsMask (1<<1)
  573. #define XkbModifierMapMask (1<<2)
  574. #define XkbExplicitComponentsMask (1<<3)
  575. #define XkbKeyActionsMask (1<<4)
  576. #define XkbKeyBehaviorsMask (1<<5)
  577. #define XkbVirtualModsMask (1<<6)
  578. #define XkbVirtualModMapMask (1<<7)
  579. #define XkbAllClientInfoMask (XkbKeyTypesMask|XkbKeySymsMask|XkbModifierMapMask)
  580. #define XkbAllServerInfoMask (XkbExplicitComponentsMask|XkbKeyActionsMask|XkbKeyBehaviorsMask|XkbVirtualModsMask|XkbVirtualModMapMask)
  581. #define XkbAllMapComponentsMask (XkbAllClientInfoMask|XkbAllServerInfoMask)
  582.     /*
  583.      * Symbol interpretations flags:
  584.      *  - Used in the flags field of a symbol interpretation
  585.      */
  586. #define XkbSI_AutoRepeat (1<<0)
  587. #define XkbSI_LockingKey (1<<1)
  588.     /*
  589.      * Symbol interpretations match specification:
  590.      *  - Used in the match field of a symbol interpretation to specify 
  591.      *    the conditions under which an interpretation is used.
  592.      */
  593. #define XkbSI_LevelOneOnly (0x80)
  594. #define XkbSI_OpMask (0x7f)
  595. #define XkbSI_NoneOf (0)
  596. #define XkbSI_AnyOfOrNone (1)
  597. #define XkbSI_AnyOf (2)
  598. #define XkbSI_AllOf (3)
  599. #define XkbSI_Exactly (4)
  600.     /*
  601.      * Indicator map flags:
  602.      *  - Used in the flags field of an indicator map to indicate the
  603.      *    conditions under which and indicator can be changed and the
  604.      *    effects of changing the indicator.
  605.      */
  606. #define XkbIM_NoExplicit (1L << 7)
  607. #define XkbIM_NoAutomatic (1L << 6)
  608. #define XkbIM_LEDDrivesKB (1L << 5)
  609.     /*
  610.      * Indicator map component specifications:
  611.      *  - Used by the 'which_groups' and 'which_mods' fields of an indicator
  612.      *    map to specify which keyboard components should be used to drive
  613.      *    the indicator.
  614.      */
  615. #define XkbIM_UseBase (1L << 0)
  616. #define XkbIM_UseLatched (1L << 1)
  617. #define XkbIM_UseLocked (1L << 2)
  618. #define XkbIM_UseEffective (1L << 3)
  619. #define XkbIM_UseCompat (1L << 4)
  620. #define XkbIM_UseNone   0
  621. #define XkbIM_UseAnyGroup (XkbIM_UseBase|XkbIM_UseLatched|XkbIM_UseLocked
  622.                            |XkbIM_UseEffective)
  623. #define XkbIM_UseAnyMods  (XkbIM_UseAnyGroup|XkbIM_UseCompat)
  624.     /*
  625.      * Compatibility Map Compontents:
  626.      *  - Specifies the components to be allocated in XkbAllocCompatMap.
  627.      */
  628. #define XkbSymInterpMask (1<<0)
  629. #define XkbGroupCompatMask (1<<1)
  630. #define XkbAllCompatMask (0x3)
  631.     /*
  632.      * Names component mask:
  633.      *  - Specifies the names to be loaded or changed for the GetNames and
  634.      *    SetNames requests.
  635.      *  - Specifies the names that have changed in a NamesNotify event.
  636.      *  - Specifies the names components to be allocated by XkbAllocNames.
  637.      */
  638. #define XkbKeycodesNameMask (1<<0)
  639. #define XkbGeometryNameMask (1<<1)
  640. #define XkbSymbolsNameMask (1<<2)
  641. #define XkbPhysSymbolsNameMask (1<<3)
  642. #define XkbTypesNameMask (1<<4)
  643. #define XkbCompatNameMask  (1<<5)
  644. #define XkbKeyTypeNamesMask (1<<6)
  645. #define XkbKTLevelNamesMask (1<<7)
  646. #define XkbIndicatorNamesMask (1<<8)
  647. #define XkbKeyNamesMask (1<<9)
  648. #define XkbKeyAliasesMask (1<<10)
  649. #define XkbVirtualModNamesMask (1<<11)
  650. #define XkbGroupNamesMask (1<<12)
  651. #define XkbRGNamesMask (1<<13)
  652. #define XkbComponentNamesMask (0x3f)
  653. #define XkbAllNamesMask (0x3fff)
  654.     /*
  655.      * GetByName components:
  656.      *  - Specifies desired or necessary components to GetKbdByName request.
  657.      *  - Reports the components that were found in a GetKbdByNameReply
  658.      */
  659. #define XkbGBN_TypesMask (1L << 0)
  660. #define XkbGBN_CompatMapMask (1L << 1)
  661. #define XkbGBN_ClientSymbolsMask (1L << 2)
  662. #define XkbGBN_ServerSymbolsMask (1L << 3)
  663. #define XkbGBN_SymbolsMask (XkbGBN_ClientSymbolsMask|XkbGBN_ServerSymbolsMask)
  664. #define XkbGBN_IndicatorMapMask (1L << 4)
  665. #define XkbGBN_KeyNamesMask (1L << 5)
  666. #define XkbGBN_GeometryMask (1L << 6)
  667. #define XkbGBN_OtherNamesMask (1L << 7)
  668. #define XkbGBN_AllComponentsMask (0xff)
  669.      /*
  670.       * ListComponents flags
  671.       */
  672. #define XkbLC_Hidden (1L <<  0)
  673. #define XkbLC_Default (1L <<  1)
  674. #define XkbLC_Partial (1L <<  2)
  675. #define XkbLC_AlphanumericKeys (1L <<  8)
  676. #define XkbLC_ModifierKeys (1L <<  9)
  677. #define XkbLC_KeypadKeys (1L << 10)
  678. #define XkbLC_FunctionKeys (1L << 11)
  679. #define XkbLC_AlternateGroup (1L << 12)
  680.     /*
  681.      * X Input Extension Interactions
  682.      * - Specifies the possible interactions between XKB and the X input
  683.      *   extension
  684.      * - Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo)
  685.      *   XKB information about an extension device.
  686.      * - Reports the list of supported optional features in the reply to
  687.      *   XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event.
  688.      * XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify
  689.      * events to indicate an attempt to use an unsupported feature.
  690.      */
  691. #define XkbXI_KeyboardsMask (1L << 0)
  692. #define XkbXI_ButtonActionsMask (1L << 1)
  693. #define XkbXI_IndicatorNamesMask (1L << 2)
  694. #define XkbXI_IndicatorMapsMask (1L << 3)
  695. #define XkbXI_IndicatorStateMask (1L << 4)
  696. #define XkbXI_UnsupportedFeatureMask (1L << 15)
  697. #define XkbXI_AllFeaturesMask (0x001f)
  698. #define XkbXI_AllDeviceFeaturesMask (0x001e)
  699. #define XkbXI_IndicatorsMask (0x001c)
  700. #define XkbAllExtensionDeviceEventsMask (0x801f)
  701.     /*
  702.      * Per-Client Flags:
  703.      *  - Specifies flags to be changed by the PerClientFlags request.
  704.      */
  705. #define XkbPCF_DetectableAutoRepeatMask (1L << 0)
  706. #define XkbPCF_GrabsUseXKBStateMask (1L << 1)
  707. #define XkbPCF_AutoResetControlsMask (1L << 2)
  708. #define XkbPCF_LookupStateWhenGrabbed (1L << 3)
  709. #define XkbPCF_SendEventUsesXKBState (1L << 4)
  710. #define XkbPCF_AllFlagsMask (0x1F)
  711.     /*
  712.      * Debugging flags and controls
  713.      */
  714. #define XkbDF_DisableLocks (1<<0)
  715. #endif /* _XKB_H_ */