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