📄 xkb.h
字号:
/* $XConsortium: XKB.h /main/14 1996/02/05 10:19:11 kaleb $ *//************************************************************Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.Permission to use, copy, modify, and distribute thissoftware and its documentation for any purpose and withoutfee is hereby granted, provided that the above copyrightnotice appear in all copies and that both that copyrightnotice and this permission notice appear in supportingdocumentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission.Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is"without any express or implied warranty.SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICONGRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITHTHE USE OR PERFORMANCE OF THIS SOFTWARE.********************************************************/#ifndef _XKB_H_#define _XKB_H_ /* * XKB request codes, used in: * - xkbReqType field of all requests * - requestMinor field of some events */#define X_kbUseExtension 0#define X_kbSelectEvents 1#define X_kbBell 3#define X_kbGetState 4#define X_kbLatchLockState 5#define X_kbGetControls 6#define X_kbSetControls 7#define X_kbGetMap 8#define X_kbSetMap 9#define X_kbGetCompatMap 10#define X_kbSetCompatMap 11#define X_kbGetIndicatorState 12#define X_kbGetIndicatorMap 13#define X_kbSetIndicatorMap 14#define X_kbGetNamedIndicator 15#define X_kbSetNamedIndicator 16#define X_kbGetNames 17#define X_kbSetNames 18#define X_kbGetGeometry 19#define X_kbSetGeometry 20#define X_kbPerClientFlags 21#define X_kbListComponents 22#define X_kbGetKbdByName 23#define X_kbGetDeviceInfo 24#define X_kbSetDeviceInfo 25#define X_kbSetDebuggingFlags 101 /* * In the X sense, XKB reports only one event. * The type field of all XKB events is XkbEventCode */#define XkbEventCode 0#define XkbNumberEvents (XkbEventCode+1) /* * XKB has a minor event code so it can use one X event code for * multiple purposes. * - reported in the xkbType field of all XKB events. * - XkbSelectEventDetails: Indicates the event for which event details * are being changed */#define XkbNewKeyboardNotify 0#define XkbMapNotify 1#define XkbStateNotify 2#define XkbControlsNotify 3#define XkbIndicatorStateNotify 4#define XkbIndicatorMapNotify 5#define XkbNamesNotify 6#define XkbCompatMapNotify 7#define XkbBellNotify 8#define XkbActionMessage 9#define XkbAccessXNotify 10#define XkbExtensionDeviceNotify 11 /* * Event Mask: * - XkbSelectEvents: Specifies event interest. */#define XkbNewKeyboardNotifyMask (1L << 0)#define XkbMapNotifyMask (1L << 1)#define XkbStateNotifyMask (1L << 2)#define XkbControlsNotifyMask (1L << 3)#define XkbIndicatorStateNotifyMask (1L << 4)#define XkbIndicatorMapNotifyMask (1L << 5)#define XkbNamesNotifyMask (1L << 6)#define XkbCompatMapNotifyMask (1L << 7)#define XkbBellNotifyMask (1L << 8)#define XkbActionMessageMask (1L << 9)#define XkbAccessXNotifyMask (1L << 10)#define XkbExtensionDeviceNotifyMask (1L << 11)#define XkbAllEventsMask (0xFFF) /* * NewKeyboardNotify event details: */#define XkbNKN_KeycodesMask (1L << 0)#define XkbNKN_GeometryMask (1L << 1)#define XkbNKN_DeviceIDMask (1L << 2)#define XkbAllNewKeyboardEventsMask (0x7) /* * AccessXNotify event types: * - The 'what' field of AccessXNotify events reports the * reason that the event was generated. */#define XkbAXN_SKPress 0#define XkbAXN_SKAccept 1#define XkbAXN_SKReject 2#define XkbAXN_SKRelease 3#define XkbAXN_BKAccept 4#define XkbAXN_BKReject 5#define XkbAXN_AXKWarning 6 /* * AccessXNotify details: * - Used as an event detail mask to limit the conditions under which * AccessXNotify events are reported */#define XkbAXN_SKPressMask (1L << 0)#define XkbAXN_SKAcceptMask (1L << 1)#define XkbAXN_SKRejectMask (1L << 2)#define XkbAXN_SKReleaseMask (1L << 3)#define XkbAXN_BKAcceptMask (1L << 4)#define XkbAXN_BKRejectMask (1L << 5)#define XkbAXN_AXKWarningMask (1L << 6)#define XkbAllAccessXEventsMask (0xf) /* * Miscellaneous event details: * - event detail masks for assorted events that don't reall * have any details. */#define XkbAllStateEventsMask XkbAllStateComponentsMask#define XkbAllMapEventsMask XkbAllMapComponentsMask#define XkbAllControlEventsMask XkbAllControlsMask#define XkbAllIndicatorEventsMask XkbAllIndicatorsMask#define XkbAllNameEventsMask XkbAllNamesMask#define XkbAllCompatMapEventsMask XkbAllCompatMask#define XkbAllBellEventsMask (1L << 0)#define XkbAllActionMessagesMask (1L << 0) /* * XKB reports one error: BadKeyboard * A further reason for the error is encoded into to most significant * byte of the resourceID for the error: * XkbErr_BadDevice - the device in question was not found * XkbErr_BadClass - the device was found but it doesn't belong to * the appropriate class. * XkbErr_BadId - the device was found and belongs to the right * class, but not feedback with a matching id was * found. * The low byte of the resourceID for this error contains the device * id, class specifier or feedback id that failed. */#define XkbKeyboard 0#define XkbNumberErrors 1#define XkbErr_BadDevice 0xff#define XkbErr_BadClass 0xfe#define XkbErr_BadId 0xfd /* * Keyboard Components Mask: * - Specifies the components that follow a GetKeyboardByNameReply */#define XkbClientMapMask (1L << 0)#define XkbServerMapMask (1L << 1)#define XkbCompatMapMask (1L << 2)#define XkbIndicatorMapMask (1L << 3)#define XkbNamesMask (1L << 4)#define XkbGeometryMask (1L << 5)#define XkbControlsMask (1L << 6)#define XkbAllComponentsMask (0x7f) /* * State detail mask: * - The 'changed' field of StateNotify events reports which of * the keyboard state components have changed. * - Used as an event detail mask to limit the conditions under * which StateNotify events are reported. */#define XkbModifierStateMask (1L << 0)#define XkbModifierBaseMask (1L << 1)#define XkbModifierLatchMask (1L << 2)#define XkbModifierLockMask (1L << 3)#define XkbGroupStateMask (1L << 4)#define XkbGroupBaseMask (1L << 5)#define XkbGroupLatchMask (1L << 6)#define XkbGroupLockMask (1L << 7)#define XkbCompatStateMask (1L << 8)#define XkbGrabModsMask (1L << 9)#define XkbCompatGrabModsMask (1L << 10)#define XkbLookupModsMask (1L << 11)#define XkbCompatLookupModsMask (1L << 12)#define XkbPointerButtonMask (1L << 13)#define XkbAllStateComponentsMask (0x3fff) /* * Controls detail masks: * The controls specified in XkbAllControlsMask: * - The 'changed' field of ControlsNotify events reports which of * the keyboard controls have changed. * - The 'changeControls' field of the SetControls request specifies * the controls for which values are to be changed. * - Used as an event detail mask to limit the conditions under * which ControlsNotify events are reported. * * The controls specified in the XkbAllBooleanCtrlsMask: * - The 'enabledControls' field of ControlsNotify events reports the * current status of the boolean controls. * - The 'enabledControlsChanges' field of ControlsNotify events reports * any boolean controls that have been turned on or off. * - The 'affectEnabledControls' and 'enabledControls' fields of the * kbSetControls request change the set of enabled controls. * - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of * an XkbControlsRec specify the controls to be changed if the keyboard * times out and the values to which they should be changed. * - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags * request specifies the specify the controls to be reset when the * client exits and the values to which they should be reset. * - The 'ctrls' field of an indicator map specifies the controls * that drive the indicator. * - Specifies the boolean controls affected by the SetControls and * LockControls key actions. */#define XkbRepeatKeysMask (1L << 0)#define XkbSlowKeysMask (1L << 1)#define XkbBounceKeysMask (1L << 2)#define XkbStickyKeysMask (1L << 3)#define XkbMouseKeysMask (1L << 4)#define XkbMouseKeysAccelMask (1L << 5)#define XkbAccessXKeysMask (1L << 6)#define XkbAccessXTimeoutMask (1L << 7)#define XkbAccessXFeedbackMask (1L << 8)#define XkbAudibleBellMask (1L << 9)#define XkbOverlay1Mask (1L << 10)#define XkbOverlay2Mask (1L << 11)#define XkbIgnoreGroupLockMask (1L << 12)#define XkbGroupsWrapMask (1L << 27)#define XkbInternalModsMask (1L << 28)#define XkbIgnoreLockModsMask (1L << 29)#define XkbPerKeyRepeatMask (1L << 30)#define XkbControlsEnabledMask (1L << 31)#define XkbAllBooleanCtrlsMask (0x00001FFF)#define XkbAllControlsMask (0xF8001FFF)#define XkbAllControlEventsMask XkbAllControlsMask /* * AccessX Options Mask * - The 'accessXOptions' field of an XkbControlsRec specifies the * AccessX options that are currently in effect. * - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues' * fields of an XkbControlsRec specify the Access X options to be * changed if the keyboard times out and the values to which they * should be changed. */#define XkbAX_SKPressFBMask (1L << 0)#define XkbAX_SKAcceptFBMask (1L << 1)#define XkbAX_FeatureFBMask (1L << 2)#define XkbAX_SlowWarnFBMask (1L << 3)#define XkbAX_IndicatorFBMask (1L << 4)#define XkbAX_StickyKeysFBMask (1L << 5)#define XkbAX_TwoKeysMask (1L << 6)#define XkbAX_LatchToLockMask (1L << 7)#define XkbAX_SKReleaseFBMask (1L << 8)#define XkbAX_SKRejectFBMask (1L << 9)#define XkbAX_BKRejectFBMask (1L << 10)#define XkbAX_DumbBellFBMask (1L << 11)#define XkbAX_FBOptionsMask (0xF3F)#define XkbAX_SKOptionsMask (0x0C0)#define XkbAX_AllOptionsMask (0xFFF) /* * XkbUseCoreKbd is used to specify the core keyboard without having * to look up its X input extension identifier. * XkbUseCorePtr is used to specify the core pointer without having * to look up its X input extension identifier. * XkbDfltXIClass is used to specify "don't care" any place that the * XKB protocol is looking for an X Input Extension * device class. * XkbDfltXIId is used to specify "don't care" any place that the * XKB protocol is looking for an X Input Extension * feedback identifier. * XkbAllXIClasses is used to get information about all device indicators, * whether they're part of the indicator feedback class * or the keyboard feedback class. * XkbAllXIIds is used to get information about all device indicator * feedbacks without having to list them. * XkbXINone is used to indicate that no class or id has been specified. * XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device * XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class * XkbExplicitXIId(c) True if 'i' explicitly specifies a device id * XkbSingleXIClass(c) True if 'c' specifies exactly one device class, * including the default. * XkbSingleXIId(i) True if 'i' specifies exactly one device * identifier, including the default. */#define XkbUseCoreKbd 0x0100#define XkbUseCorePtr 0x0200#define XkbDfltXIClass 0x0300#define XkbDfltXIId 0x0400#define XkbAllXIClasses 0x0500#define XkbAllXIIds 0x0600#define XkbXINone 0xff00#define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||\ ((c)==LedFeedbackClass)||\ ((c)==XkbDfltXIClass)||\ ((c)==XkbAllXIClasses))#define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||\ ((c)==BellFeedbackClass)||\ ((c)==XkbDfltXIClass)||\ ((c)==XkbAllXIClasses))#define XkbExplicitXIDevice(c) (((c)&(~0xff))==0)#define XkbExplicitXIClass(c) (((c)&(~0xff))==0)#define XkbExplicitXIId(c) (((c)&(~0xff))==0)#define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass))#define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId))#define XkbNoModifier 0xff#define XkbNoShiftLevel 0xff#define XkbNoShape 0xff#define XkbNoIndicator 0xff#define XkbNoModifierMask 0#define XkbAllModifiersMask 0xff#define XkbAllVirtualModsMask 0xffff#define XkbNumKbdGroups 4#define XkbMaxKbdGroup (XkbNumKbdGroups-1)#define XkbMaxMouseKeysBtn 4 /* * Group Index and Mask: * - Indices into the kt_index array of a key type. * - Mask specifies types to be changed for XkbChangeTypesOfKey */#define XkbGroup1Index 0#define XkbGroup2Index 1#define XkbGroup3Index 2#define XkbGroup4Index 3#define XkbAnyGroup 254#define XkbAllGroups 255#define XkbGroup1Mask (1<<0)#define XkbGroup2Mask (1<<1)#define XkbGroup3Mask (1<<2)#define XkbGroup4Mask (1<<3)#define XkbAnyGroupMask (1<<7)#define XkbAllGroupsMask (0xf) /* * BuildCoreState: Given a keyboard group and a modifier state, * construct the value to be reported an event. * GroupForCoreState: Given the state reported in an event, * determine the keyboard group. * IsLegalGroup: Returns TRUE if 'g' is a valid group index. */#define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff))#define XkbGroupForCoreState(s) (((s)>>13)&0x3)#define XkbIsLegalGroup(g) (((g)>=0)&&((g)<XkbNumKbdGroups)) /* * GroupsWrap values: * - The 'groupsWrap' field of an XkbControlsRec specifies the * treatment of out of range groups. * - Bits 6 and 7 of the group info field of a key symbol map * specify the interpretation of out of range groups for the * corresponding key. */#define XkbWrapIntoRange (0x00)#define XkbClampIntoRange (0x40)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -