-
Notifications
You must be signed in to change notification settings - Fork 3
/
xevent_type.c
117 lines (115 loc) · 1.78 KB
/
xevent_type.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* Copyright Phillip Potter, 2020 - MIT License */
#include <X11/Xlib.h>
/* This turns events into strings */
const char *getEventType(XEvent *event)
{
const char *retVal;
switch (event->type) {
case 2:
retVal = "KeyPress";
break;
case 3:
retVal = "KeyRelease";
break;
case 4:
retVal = "ButtonPress";
break;
case 5:
retVal = "ButtonRelease";
break;
case 6:
retVal = "MotionNotify";
break;
case 7:
retVal = "EnterNotify";
break;
case 8:
retVal = "LeaveNotify";
break;
case 9:
retVal = "FocusIn";
break;
case 10:
retVal = "FocusOut";
break;
case 11:
retVal = "KeymapNotify";
break;
case 12:
retVal = "Expose";
break;
case 13:
retVal = "GraphicsExpose";
break;
case 14:
retVal = "NoExpose";
break;
case 15:
retVal = "VisibilityNotify";
break;
case 16:
retVal = "CreateNotify";
break;
case 17:
retVal = "DestroyNotify";
break;
case 18:
retVal = "UnmapNotify";
break;
case 19:
retVal = "MapNotify";
break;
case 20:
retVal = "MapRequest";
break;
case 21:
retVal = "ReparentNotify";
break;
case 22:
retVal = "ConfigureNotify";
break;
case 23:
retVal = "ConfigureRequest";
break;
case 24:
retVal = "GravityNotify";
break;
case 25:
retVal = "ResizeRequest";
break;
case 26:
retVal = "CirculateNotify";
break;
case 27:
retVal = "CirculateRequest";
break;
case 28:
retVal = "PropertyNotify";
break;
case 29:
retVal = "SelectionClear";
break;
case 30:
retVal = "SelectionRequest";
break;
case 31:
retVal = "SelectionNotify";
break;
case 32:
retVal = "ColormapNotify";
break;
case 33:
retVal = "ClientMessage";
break;
case 34:
retVal = "MappingNotify";
break;
case 35:
retVal = "GenericEvent";
break;
default:
retVal = "Unknown";
break;
}
return retVal;
}