PageRenderTime 108ms CodeModel.GetById 20ms app.highlight 80ms RepoModel.GetById 2ms app.codeStats 0ms

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