/binding/x/X.d

http://github.com/wilkie/djehuty · D · 950 lines · 706 code · 105 blank · 139 comment · 0 complexity · 41c3290683900726691d59337d955949 MD5 · raw file

  1. /*
  2. * X.d
  3. *
  4. * This file holds X bindings. Much of this file was taken from bindings
  5. * by Teissier Sylvere's alpha release. I have fixed the errors. His
  6. * original copyright notice is below.
  7. *
  8. * Author: Teissier Sylvere, Dave Wilkinson
  9. *
  10. */
  11. /* Xlib binding for D language
  12. Copyright 2007 TEISSIER Sylvere sligor(at)free.fr
  13. version 0.1 2007/08/29
  14. This binding is an alpha release and need to be more tested
  15. This file is free software, please read licence.txt for more informations
  16. */
  17. module binding.x.X;
  18. import core.definitions;
  19. const uint X_PROTOCOL=11; /* current protocol version */
  20. const uint X_PROTOCOL_REVISION=0; /* current minor version */
  21. /* Resources */
  22. alias Culong XID;
  23. alias Culong Mask;
  24. alias Culong VisualID;
  25. alias Culong Time;
  26. alias XID Atom; //alias needed because of None invariant shared for Atom and XID
  27. alias XID Window;
  28. alias XID Drawable;
  29. alias XID Font;
  30. alias XID Pixmap;
  31. alias XID Cursor;
  32. alias XID Colormap;
  33. alias XID GContext;
  34. alias XID KeySym;
  35. alias uint KeyCode;
  36. /*****************************************************************
  37. * RESERVED RESOURCE AND CONSTANT DEFINITIONS
  38. *****************************************************************/
  39. /* universal null resource or null atom */
  40. const XID None=0;
  41. /* border pixmap in CreateWindow and ChangeWindowAttributes special VisualID and special window class passed to CreateWindow */
  42. const uint ParentRelative=1;
  43. /* background pixmap in CreateWindow and ChangeWindowAttributes */
  44. const uint CopyFromParent=0;
  45. /* destination window in SendEvent */
  46. const Window PointerWindow=0;
  47. /* destination window in SendEvent */
  48. const Window InputFocus=1;
  49. /* focus window in SetInputFocus */
  50. const Window PointerRoot=1;
  51. /* special Atom, passed to GetProperty */
  52. const Atom AnyPropertyType=0;
  53. /* special Key Code, passed to GrabKey */
  54. const KeyCode AnyKey=0;
  55. /* special Button Code, passed to GrabButton */
  56. const uint AnyButton=0;
  57. /* special Resource ID passed to KillClient */
  58. const XID AllTemporary=0;
  59. /* special Time */
  60. const Time CurrentTime=0;
  61. /* special KeySym */
  62. const KeySym NoSymbol=0;
  63. /*****************************************************************
  64. * EVENT DEFINITIONS
  65. *****************************************************************/
  66. /* Input Event Masks. Used as event-mask window attribute and as arguments
  67. to Grab requests. Not to be confused with event names. */
  68. enum EventMask:Clong
  69. {
  70. NoEventMask =0,
  71. KeyPressMask =1<<0,
  72. KeyReleaseMask =1<<1,
  73. ButtonPressMask =1<<2,
  74. ButtonReleaseMask =1<<3,
  75. EnterWindowMask =1<<4,
  76. LeaveWindowMask =1<<5,
  77. PointerMotionMask =1<<6,
  78. PointerMotionHintMask =1<<7,
  79. Button1MotionMask =1<<8,
  80. Button2MotionMask =1<<9,
  81. Button3MotionMask =1<<10,
  82. Button4MotionMask =1<<11,
  83. Button5MotionMask =1<<12,
  84. ButtonMotionMask =1<<13,
  85. KeymapStateMask =1<<14,
  86. ExposureMask =1<<15,
  87. VisibilityChangeMask =1<<16,
  88. StructureNotifyMask =1<<17,
  89. ResizeRedirectMask =1<<18,
  90. SubstructureNotifyMask =1<<19,
  91. SubstructureRedirectMask=1<<20,
  92. FocusChangeMask =1<<21,
  93. PropertyChangeMask =1<<22,
  94. ColormapChangeMask =1<<23,
  95. OwnerGrabButtonMask =1<<24
  96. };
  97. /* Event names. Used in "type" field in XEvent structures. Not to be
  98. confused with event masks above. They start from 2 because 0 and 1
  99. are reserved in the protocol for errors and replies. */
  100. enum EventType:int
  101. {
  102. KeyPress =2,
  103. KeyRelease =3,
  104. ButtonPress =4,
  105. ButtonRelease =5,
  106. MotionNotify =6,
  107. EnterNotify =7,
  108. LeaveNotify =8,
  109. FocusIn =9,
  110. FocusOut =10,
  111. KeymapNotify =11,
  112. Expose =12,
  113. GraphicsExpose =13,
  114. NoExpose =14,
  115. VisibilityNotify =15,
  116. CreateNotify =16,
  117. DestroyNotify =17,
  118. UnmapNotify =18,
  119. MapNotify =19,
  120. MapRequest =20,
  121. ReparentNotify =21,
  122. ConfigureNotify =22,
  123. ConfigureRequest =23,
  124. GravityNotify =24,
  125. ResizeRequest =25,
  126. CirculateNotify =26,
  127. CirculateRequest =27,
  128. PropertyNotify =28,
  129. SelectionClear =29,
  130. SelectionRequest =30,
  131. SelectionNotify =31,
  132. ColormapNotify =32,
  133. ClientMessage =33,
  134. MappingNotify =34,
  135. LASTEvent =35 /* must be bigger than any event # */
  136. };
  137. /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
  138. state in various key-, mouse-, and button-related events. */
  139. enum KeyMask:uint
  140. {
  141. ShiftMask =1<<0,
  142. LockMask =1<<1,
  143. ControlMask =1<<2,
  144. Mod1Mask =1<<3,
  145. Mod2Mask =1<<4,
  146. Mod3Mask =1<<5,
  147. Mod4Mask =1<<6,
  148. Mod5Mask =1<<7,
  149. AnyModifier =1<<15/* used in GrabButton, GrabKey */
  150. };
  151. /* modifier names. Used to build a SetModifierMapping request or
  152. to read a GetModifierMapping request. These correspond to the
  153. masks defined above. */
  154. enum ModifierName:int
  155. {
  156. ShiftMapIndex =0,
  157. LockMapIndex =1,
  158. ControlMapIndex =2,
  159. Mod1MapIndex =3,
  160. Mod2MapIndex =4,
  161. Mod3MapIndex =5,
  162. Mod4MapIndex =6,
  163. Mod5MapIndex =7
  164. };
  165. enum ButtonMask:int
  166. {
  167. Button1Mask =1<<8,
  168. Button2Mask =1<<9,
  169. Button3Mask =1<<10,
  170. Button4Mask =1<<11,
  171. Button5Mask =1<<12,
  172. AnyModifier =1<<15/* used in GrabButton, GrabKey */
  173. };
  174. enum KeyOrButtonMask:uint
  175. {
  176. ShiftMask =1<<0,
  177. LockMask =1<<1,
  178. ControlMask =1<<2,
  179. Mod1Mask =1<<3,
  180. Mod2Mask =1<<4,
  181. Mod3Mask =1<<5,
  182. Mod4Mask =1<<6,
  183. Mod5Mask =1<<7,
  184. Button1Mask =1<<8,
  185. Button2Mask =1<<9,
  186. Button3Mask =1<<10,
  187. Button4Mask =1<<11,
  188. Button5Mask =1<<12,
  189. AnyModifier =1<<15/* used in GrabButton, GrabKey */
  190. };
  191. /* button names. Used as arguments to GrabButton and as detail in ButtonPress
  192. and ButtonRelease events. Not to be confused with button masks above.
  193. Note that 0 is already defined above as "AnyButton". */
  194. enum ButtonName:int
  195. {
  196. Button1 =1,
  197. Button2 =2,
  198. Button3 =3,
  199. Button4 =4,
  200. Button5 =5
  201. };
  202. /* Notify modes */
  203. enum NotifyModes:int
  204. {
  205. NotifyNormal =0,
  206. NotifyGrab =1,
  207. NotifyUngrab =2,
  208. NotifyWhileGrabbed =3
  209. };
  210. const int NotifyHint =1; /* for MotionNotify events */
  211. /* Notify detail */
  212. enum NotifyDetail:int
  213. {
  214. NotifyAncestor =0,
  215. NotifyVirtual =1,
  216. NotifyInferior =2,
  217. NotifyNonlinear =3,
  218. NotifyNonlinearVirtual =4,
  219. NotifyPointer =5,
  220. NotifyPointerRoot =6,
  221. NotifyDetailNone =7
  222. };
  223. /* Visibility notify */
  224. enum VisibilityNotify:int
  225. {
  226. VisibilityUnobscured =0,
  227. VisibilityPartiallyObscured =1,
  228. VisibilityFullyObscured =2
  229. };
  230. /* Circulation request */
  231. enum CirculationRequest:int
  232. {
  233. PlaceOnTop =0,
  234. PlaceOnBottom =1
  235. };
  236. /* protocol families */
  237. enum ProtocolFamlily:int
  238. {
  239. FamilyInternet =0, /* IPv4 */
  240. FamilyDECnet =1,
  241. FamilyChaos =2,
  242. FamilyServerInterpreted =5, /* authentication families not tied to a specific protocol */
  243. FamilyInternet6 =6 /* IPv6 */
  244. };
  245. /* Property notification */
  246. enum PropertyNotification:int
  247. {
  248. PropertyNewValue =0,
  249. PropertyDelete =1
  250. };
  251. /* Color Map notification */
  252. enum ColorMapNotification:int
  253. {
  254. ColormapUninstalled =0,
  255. ColormapInstalled =1
  256. };
  257. /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
  258. enum GrabMode:int
  259. {
  260. GrabModeSync =0,
  261. GrabModeAsync =1
  262. };
  263. /* GrabPointer, GrabKeyboard reply status */
  264. enum GrabReplyStatus:int
  265. {
  266. GrabSuccess =0,
  267. AlreadyGrabbed =1,
  268. GrabInvalidTime =2,
  269. GrabNotViewable =3,
  270. GrabFrozen =4
  271. };
  272. /* AllowEvents modes */
  273. enum AllowEventMode:int
  274. {
  275. AsyncPointer =0,
  276. SyncPointer =1,
  277. ReplayPointer =2,
  278. AsyncKeyboard =3,
  279. SyncKeyboard =4,
  280. ReplayKeyboard =5,
  281. AsyncBoth =6,
  282. SyncBoth =7
  283. };
  284. /* Used in SetInputFocus, GetInputFocus */
  285. enum InputFocusRevertTo:int
  286. {
  287. RevertToNone =None,
  288. RevertToPointerRoot =PointerRoot,
  289. RevertToParent =2
  290. };
  291. /*****************************************************************
  292. * ERROR CODES
  293. *****************************************************************/
  294. enum XErrorCode:int
  295. {
  296. Success =0, /* everything's okay */
  297. BadRequest =1, /* bad request code */
  298. BadValue =2, /* int parameter out of range */
  299. BadWindow =3, /* parameter not a Window */
  300. BadPixmap =4, /* parameter not a Pixmap */
  301. BadAtom =5, /* parameter not an Atom */
  302. BadCursor =6, /* parameter not a Cursor */
  303. BadFont =7, /* parameter not a Font */
  304. BadMatch =8, /* parameter mismatch */
  305. BadDrawable =9, /* parameter not a Pixmap or Window */
  306. BadAccess =10, /* depending on context:
  307. - key/button already grabbed
  308. - attempt to free an illegal
  309. cmap entry
  310. - attempt to store into a read-only
  311. color map entry.
  312. - attempt to modify the access control
  313. list from other than the local host.
  314. */
  315. BadAlloc =11, /* insufficient resources */
  316. BadColor =12, /* no such colormap */
  317. BadGC =13, /* parameter not a GC */
  318. BadIDChoice =14, /* choice not in range or already used */
  319. BadName =15, /* font or color name doesn't exist */
  320. BadLength =16, /* Request length incorrect */
  321. BadImplementation =17, /* server is defective */
  322. FirstExtensionError =128,
  323. LastExtensionError =255
  324. };
  325. /*****************************************************************
  326. * WINDOW DEFINITIONS
  327. *****************************************************************/
  328. /* Window classes used by CreateWindow */
  329. /* Note that CopyFromParent is already defined as 0 above */
  330. enum WindowClass:int
  331. {
  332. CopyFromParent =0,
  333. InputOutput =1,
  334. InputOnly =2
  335. };
  336. /* Window attributes for CreateWindow and ChangeWindowAttributes */
  337. enum WindowAttribute:Culong
  338. {
  339. CWBackPixmap =1<<0,
  340. CWBackPixel =1<<1,
  341. CWBorderPixmap =1<<2,
  342. CWBorderPixel =1<<3,
  343. CWBitGravity =1<<4,
  344. CWWinGravity =1<<5,
  345. CWBackingStore =1<<6,
  346. CWBackingPlanes =1<<7,
  347. CWBackingPixel =1<<8,
  348. CWOverrideRedirect =1<<9,
  349. CWSaveUnder =1<<10,
  350. CWEventMask =1<<11,
  351. CWDontPropagate =1<<12,
  352. CWColormap =1<<13,
  353. CWCursor =1<<14
  354. };
  355. /* ConfigureWindow structure */
  356. enum ConfigureWindowStruct:int
  357. {
  358. CWX =1<<0,
  359. CWY =1<<1,
  360. CWWidth =1<<2,
  361. CWHeight =1<<3,
  362. CWBorderWidth =1<<4,
  363. CWSibling =1<<5,
  364. CWStackMode =1<<6
  365. };
  366. /* Bit Gravity */
  367. enum BitGravity:int
  368. {
  369. ForgetGravity =0,
  370. NorthWestGravity =1,
  371. NorthGravity =2,
  372. NorthEastGravity =3,
  373. WestGravity =4,
  374. CenterGravity =5,
  375. EastGravity =6,
  376. SouthWestGravity =7,
  377. SouthGravity =8,
  378. SouthEastGravity =9,
  379. StaticGravity =10
  380. };
  381. /* Window gravity + bit gravity above */
  382. const uint UnmapGravity=0;
  383. /* Used in CreateWindow for backing-store hint */
  384. enum BackingStoreHint:int
  385. {
  386. NotUseful =0,
  387. WhenMapped =1,
  388. Always =2
  389. };
  390. /* Used in GetWindowAttributes reply */
  391. enum MapState:int
  392. {
  393. IsUnmapped =0,
  394. IsUnviewable =1,
  395. IsViewable =2
  396. };
  397. /* Used in ChangeSaveSet */
  398. enum ChangeMode:int
  399. {
  400. SetModeInsert =0,
  401. SetModeDelete =1
  402. };
  403. /* Used in ChangeCloseDownMode */
  404. enum CloseDownMode:int
  405. {
  406. DestroyAll =0,
  407. RetainPermanent =1,
  408. RetainTemporary =2
  409. };
  410. /* Window stacking method (in configureWindow) */
  411. enum WindowStackingMethod:int
  412. {
  413. Above =0,
  414. Below =1,
  415. TopIf =2,
  416. BottomIf =3,
  417. Opposite =4
  418. };
  419. /* Circulation direction */
  420. enum CircularDirection:int
  421. {
  422. RaiseLowest =0,
  423. LowerHighest =1
  424. };
  425. /* Property modes */
  426. enum PropertyMode:int
  427. {
  428. PropModeReplace =0,
  429. PropModePrepend =1,
  430. PropModeAppend =2
  431. };
  432. /*****************************************************************
  433. * GRAPHICS DEFINITIONS
  434. *****************************************************************/
  435. /* graphics functions, as in GC.alu */
  436. enum GraphicFunction:int
  437. {
  438. GXclear =0x0, /* 0 */
  439. GXand =0x1, /* src AND dst */
  440. GXandReverse =0x2, /* src AND NOT dst */
  441. GXcopy =0x3, /* src */
  442. GXandInverted =0x4, /* NOT src AND dst */
  443. GXnoop =0x5, /* dst */
  444. GXxor =0x6, /* src XOR dst */
  445. GXor =0x7, /* src OR dst */
  446. GXnor =0x8, /* NOT src AND NOT dst */
  447. GXequiv =0x9, /* NOT src XOR dst */
  448. GXinvert =0xa, /* NOT dst */
  449. GXorReverse =0xb, /* src OR NOT dst */
  450. GXcopyInverted =0xc, /* NOT src */
  451. GXorInverted =0xd, /* NOT src OR dst */
  452. GXnand =0xe, /* NOT src OR NOT dst */
  453. GXset =0xf /* 1 */
  454. };
  455. /* LineStyle */
  456. enum LineStyle:int
  457. {
  458. LineSolid =0,
  459. LineOnOffDash =1,
  460. LineDoubleDash =2
  461. };
  462. /* capStyle */
  463. enum CapStyle:int
  464. {
  465. CapNotLast =0,
  466. CapButt =1,
  467. CapRound =2,
  468. CapProjecting =3
  469. };
  470. /* joinStyle */
  471. enum JoinStyle:int
  472. {
  473. JoinMiter =0,
  474. JoinRound =1,
  475. JoinBevel =2
  476. };
  477. /* fillStyle */
  478. enum FillStyle:int
  479. {
  480. FillSolid =0,
  481. FillTiled =1,
  482. FillStippled =2,
  483. FillOpaqueStippled =3
  484. };
  485. /* fillRule */
  486. enum FillRule:int
  487. {
  488. EvenOddRule =0,
  489. WindingRule =1
  490. };
  491. /* subwindow mode */
  492. enum SubwindowMode:int
  493. {
  494. ClipByChildren =0,
  495. IncludeInferiors =1
  496. };
  497. /* SetClipRectangles ordering */
  498. enum ClipRectanglesOrdering:int
  499. {
  500. Unsorted =0,
  501. YSorted =1,
  502. YXSorted =2,
  503. YXBanded =3
  504. };
  505. /* CoordinateMode for drawing routines */
  506. enum CoordinateMode:int
  507. {
  508. CoordModeOrigin =0, /* relative to the origin */
  509. CoordModePrevious =1 /* relative to previous point */
  510. };
  511. /* Polygon shapes */
  512. enum PolygonShape:int
  513. {
  514. Complex =0, /* paths may intersect */
  515. Nonconvex =1, /* no paths intersect, but not convex */
  516. Convex =2 /* wholly convex */
  517. };
  518. /* Arc modes for PolyFillArc */
  519. enum ArcMode:int
  520. {
  521. ArcChord =0, /* join endpoints of arc */
  522. ArcPieSlice =1 /* join endpoints to center of arc */
  523. };
  524. /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
  525. GC.stateChanges */
  526. enum GCMask:Culong
  527. {
  528. GCFunction =1<<0,
  529. GCPlaneMask =1<<1,
  530. GCForeground =1<<2,
  531. GCBackground =1<<3,
  532. GCLineWidth =1<<4,
  533. GCLineStyle =1<<5,
  534. GCCapStyle =1<<6,
  535. GCJoinStyle =1<<7,
  536. GCFillStyle =1<<8,
  537. GCFillRule =1<<9,
  538. GCTile =1<<10,
  539. GCStipple =1<<11,
  540. GCTileStipXOrigin =1<<12,
  541. GCTileStipYOrigin =1<<13,
  542. GCFont =1<<14,
  543. GCSubwindowMode =1<<15,
  544. GCGraphicsExposures =1<<16,
  545. GCClipXOrigin =1<<17,
  546. GCClipYOrigin =1<<18,
  547. GCClipMask =1<<19,
  548. GCDashOffset =1<<20,
  549. GCDashList =1<<21,
  550. GCArcMode =1<<22,
  551. };
  552. const uint GCLastBit=22;
  553. /*****************************************************************
  554. * FONTS
  555. *****************************************************************/
  556. /* used in QueryFont -- draw direction */
  557. enum FontDrawDirection:int
  558. {
  559. FontLeftToRight =0,
  560. FontRightToLeft =1,
  561. FontChange =255
  562. }
  563. /*****************************************************************
  564. * IMAGING
  565. *****************************************************************/
  566. /* ImageFormat -- PutImage, GetImage */
  567. enum ImageFormat:int
  568. {
  569. XYBitmap =0, /* depth 1, XYFormat */
  570. XYPixmap =1, /* depth == drawable depth */
  571. ZPixmap =2 /* depth == drawable depth */
  572. };
  573. /*****************************************************************
  574. * COLOR MAP STUFF
  575. *****************************************************************/
  576. /* For CreateColormap */
  577. enum AllocType:int
  578. {
  579. AllocNone =0, /* create map with no entries */
  580. AllocAll =1 /* allocate entire map writeable */
  581. };
  582. /* Flags used in StoreNamedColor, StoreColors */
  583. enum StoreColor:int
  584. {
  585. DoRed =1<<0,
  586. DoGreen =1<<1,
  587. DoBlue =1<<2
  588. };
  589. /*****************************************************************
  590. * CURSOR STUFF
  591. *****************************************************************/
  592. /* QueryBestSize Class */
  593. enum QueryBestSizeClass:int
  594. {
  595. CursorShape =0, /* largest size that can be displayed */
  596. TileShape =1, /* size tiled fastest */
  597. StippleShape =2 /* size stippled fastest */
  598. };
  599. /*****************************************************************
  600. * KEYBOARD/POINTER STUFF
  601. *****************************************************************/
  602. enum AutoRepeatMode:int
  603. {
  604. AutoRepeatModeOff =0,
  605. AutoRepeatModeOn =1,
  606. AutoRepeatModeDefault =2
  607. };
  608. enum LedMode:int
  609. {
  610. LedModeOff =0,
  611. LedModeOn =1
  612. };
  613. /* masks for ChangeKeyboardControl */
  614. enum KBMask:Culong
  615. {
  616. KBKeyClickPercent =1<<0,
  617. KBBellPercent =1<<1,
  618. KBBellPitch =1<<2,
  619. KBBellDuration =1<<3,
  620. KBLed =1<<4,
  621. KBLedMode =1<<5,
  622. KBKey =1<<6,
  623. KBAutoRepeatMode =1<<7
  624. };
  625. enum MappingErrorCode:int
  626. {
  627. MappingSuccess =0,
  628. MappingBusy =1,
  629. MappingFailed =2
  630. };
  631. enum MappingType:int
  632. {
  633. MappingModifier =0,
  634. MappingKeyboard =1,
  635. MappingPointer =2
  636. };
  637. /*****************************************************************
  638. * SCREEN SAVER STUFF
  639. *****************************************************************/
  640. enum ScreenSaverBlancking:int
  641. {
  642. DontPreferBlanking =0,
  643. PreferBlanking =1,
  644. DefaultBlanking =2
  645. };
  646. enum ScreenSaverDisable:int
  647. {
  648. DisableScreenSaver =0,
  649. DisableScreenInterval =0
  650. };
  651. enum ScreenSaverExposure:int
  652. {
  653. DontAllowExposures =0,
  654. AllowExposures =1,
  655. DefaultExposures =2
  656. };
  657. /* for ForceScreenSaver */
  658. enum ScreenSaverMode:int
  659. {
  660. ScreenSaverReset =0,
  661. ScreenSaverActive =1
  662. };
  663. /*****************************************************************
  664. * HOSTS AND CONNECTIONS
  665. *****************************************************************/
  666. /* for ChangeHosts */
  667. enum HostChange:int
  668. {
  669. HostInsert =0,
  670. HostDelete =1
  671. };
  672. /* for ChangeAccessControl */
  673. enum HostAccess:int
  674. {
  675. EnableAccess =1,
  676. DisableAccess =0
  677. };
  678. /* Display classes used in opening the connection
  679. * Note that the statically allocated ones are even numbered and the
  680. * dynamically changeable ones are odd numbered */
  681. enum DisplayClass:int
  682. {
  683. StaticGray =0,
  684. GrayScale =1,
  685. StaticColor =2,
  686. PseudoColor =3,
  687. TrueColor =4,
  688. DirectColor =5
  689. };
  690. /* Byte order used in imageByteOrder and bitmapBitOrder */
  691. enum ByteOrder:int
  692. {
  693. LSBFirst =0,
  694. MSBFirst =1
  695. };
  696. const int XK_BackSpace = 0xff08; /* Back space, back char */
  697. const int XK_Tab = 0xff09;
  698. const int XK_Linefeed = 0xff0a; /* Linefeed, LF */
  699. const int XK_Clear = 0xff0b;
  700. const int XK_Return = 0xff0d; /* Return, enter */
  701. const int XK_Pause = 0xff13; /* Pause, hold */
  702. const int XK_Scroll_Lock = 0xff14;
  703. const int XK_Sys_Req = 0xff15;
  704. const int XK_Escape = 0xff1b;
  705. const int XK_Delete = 0xffff; /* Delete, rubout */
  706. const int XK_Home = 0xff50;
  707. const int XK_Left = 0xff51; /* Move left, left arrow */
  708. const int XK_Up = 0xff52; /* Move up, up arrow */
  709. const int XK_Right = 0xff53; /* Move right, right arrow */
  710. const int XK_Down = 0xff54; /* Move down, down arrow */
  711. const int XK_Prior = 0xff55; /* Prior, previous */
  712. const int XK_Page_Up = 0xff55;
  713. const int XK_Next = 0xff56; /* Next */
  714. const int XK_Page_Down = 0xff56;
  715. const int XK_End = 0xff57; /* EOL */
  716. const int XK_Begin = 0xff58; /* BOL */
  717. /* Misc functions */
  718. const int XK_Select = 0xff60; /* Select, mark */
  719. const int XK_Print = 0xff61;
  720. const int XK_Execute = 0xff62; /* Execute, run, do */
  721. const int XK_Insert = 0xff63; /* Insert, insert here */
  722. const int XK_Undo = 0xff65;
  723. const int XK_Redo = 0xff66; /* Redo, again */
  724. const int XK_Menu = 0xff67;
  725. const int XK_Find = 0xff68; /* Find, search */
  726. const int XK_Cancel = 0xff69; /* Cancel, stop, abort, exit */
  727. const int XK_Help = 0xff6a; /* Help */
  728. const int XK_Break = 0xff6b;
  729. const int XK_Mode_switch = 0xff7e; /* Character set switch */
  730. const int XK_script_switch = 0xff7e; /* Alias for mode_switch */
  731. const int XK_Num_Lock = 0xff7f;
  732. const int XK_F1 = 0xffbe;
  733. const int XK_F2 = 0xffbf;
  734. const int XK_F3 = 0xffc0;
  735. const int XK_F4 = 0xffc1;
  736. const int XK_F5 = 0xffc2;
  737. const int XK_F6 = 0xffc3;
  738. const int XK_F7 = 0xffc4;
  739. const int XK_F8 = 0xffc5;
  740. const int XK_F9 = 0xffc6;
  741. const int XK_F10 = 0xffc7;
  742. const int XK_F11 = 0xffc8;
  743. const int XK_L1 = 0xffc8;
  744. const int XK_F12 = 0xffc9;
  745. const int XK_L2 = 0xffc9;
  746. const int XK_F13 = 0xffca;
  747. const int XK_L3 = 0xffca;
  748. const int XK_F14 = 0xffcb;
  749. const int XK_L4 = 0xffcb;
  750. const int XK_F15 = 0xffcc;
  751. const int XK_L5 = 0xffcc;
  752. const int XK_F16 = 0xffcd;
  753. const int XK_L6 = 0xffcd;
  754. const int XK_F17 = 0xffce;
  755. const int XK_L7 = 0xffce;
  756. const int XK_F18 = 0xffcf;
  757. const int XK_L8 = 0xffcf;
  758. const int XK_F19 = 0xffd0;
  759. const int XK_L9 = 0xffd0;
  760. const int XK_F20 = 0xffd1;
  761. const int XK_L10 = 0xffd1;
  762. const int XK_F21 = 0xffd2;
  763. const int XK_R1 = 0xffd2;
  764. const int XK_F22 = 0xffd3;
  765. const int XK_R2 = 0xffd3;
  766. const int XK_F23 = 0xffd4;
  767. const int XK_R3 = 0xffd4;
  768. const int XK_F24 = 0xffd5;
  769. const int XK_R4 = 0xffd5;
  770. const int XK_F25 = 0xffd6;
  771. const int XK_R5 = 0xffd6;
  772. const int XK_F26 = 0xffd7;
  773. const int XK_R6 = 0xffd7;
  774. const int XK_F27 = 0xffd8;
  775. const int XK_R7 = 0xffd8;
  776. const int XK_F28 = 0xffd9;
  777. const int XK_R8 = 0xffd9;
  778. const int XK_F29 = 0xffda;
  779. const int XK_R9 = 0xffda;
  780. const int XK_F30 = 0xffdb;
  781. const int XK_R10 = 0xffdb;
  782. const int XK_F31 = 0xffdc;
  783. const int XK_R11 = 0xffdc;
  784. const int XK_F32 = 0xffdd;
  785. const int XK_R12 = 0xffdd;
  786. const int XK_F33 = 0xffde;
  787. const int XK_R13 = 0xffde;
  788. const int XK_F34 = 0xffdf;
  789. const int XK_R14 = 0xffdf;
  790. const int XK_F35 = 0xffe0;
  791. const int XK_R15 = 0xffe0;
  792. /* Modifiers */
  793. const int XK_Space = 0x20;
  794. const int XK_Shift_L = 0xffe1; /* Left shift */
  795. const int XK_Shift_R = 0xffe2; /* Right shift */
  796. const int XK_Control_L = 0xffe3; /* Left control */
  797. const int XK_Control_R = 0xffe4; /* Right control */
  798. const int XK_Caps_Lock = 0xffe5; /* Caps lock */
  799. const int XK_Shift_Lock = 0xffe6; /* Shift lock */
  800. const int XK_Meta_L = 0xffe7; /* Left meta */
  801. const int XK_Meta_R = 0xffe8; /* Right meta */
  802. const int XK_Alt_L = 0xffe9; /* Left alt */
  803. const int XK_Alt_R = 0xffea; /* Right alt */
  804. const int XK_Super_L = 0xffeb; /* Left super */
  805. const int XK_Super_R = 0xffec; /* Right super */
  806. const int XK_Hyper_L = 0xffed; /* Left hyper */
  807. const int XK_Hyper_R = 0xffee; /* Right hyper */
  808. const int XK_KP_Space = 0xff80; /* Space */
  809. const int XK_KP_Tab = 0xff89;
  810. const int XK_KP_Enter = 0xff8d; /* Enter */
  811. const int XK_KP_F1 = 0xff91; /* PF1, KP_A, ... */
  812. const int XK_KP_F2 = 0xff92;
  813. const int XK_KP_F3 = 0xff93;
  814. const int XK_KP_F4 = 0xff94;
  815. const int XK_KP_Home = 0xff95;
  816. const int XK_KP_Left = 0xff96;
  817. const int XK_KP_Up = 0xff97;
  818. const int XK_KP_Right = 0xff98;
  819. const int XK_KP_Down = 0xff99;
  820. const int XK_KP_Prior = 0xff9a;
  821. const int XK_KP_Page_Up = 0xff9a;
  822. const int XK_KP_Next = 0xff9b;
  823. const int XK_KP_Page_Down = 0xff9b;
  824. const int XK_KP_End = 0xff9c;
  825. const int XK_KP_Begin = 0xff9d;
  826. const int XK_KP_Insert = 0xff9e;
  827. const int XK_KP_Delete = 0xff9f;
  828. const int XK_KP_Equal = 0xffbd; /* Equals */
  829. const int XK_KP_Multiply = 0xffaa;
  830. const int XK_KP_Add = 0xffab;
  831. const int XK_KP_Separator = 0xffac; /* Separator, often comma */
  832. const int XK_KP_Subtract = 0xffad;
  833. const int XK_KP_Decimal = 0xffae;
  834. const int XK_KP_Divide = 0xffaf;
  835. const int XK_KP_0 = 0xffb0;
  836. const int XK_KP_1 = 0xffb1;
  837. const int XK_KP_2 = 0xffb2;
  838. const int XK_KP_3 = 0xffb3;
  839. const int XK_KP_4 = 0xffb4;
  840. const int XK_KP_5 = 0xffb5;
  841. const int XK_KP_6 = 0xffb6;
  842. const int XK_KP_7 = 0xffb7;
  843. const int XK_KP_8 = 0xffb8;
  844. const int XK_KP_9 = 0xffb9;