-
Notifications
You must be signed in to change notification settings - Fork 0
/
mlx_events.h
175 lines (158 loc) · 5.17 KB
/
mlx_events.h
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mlx_events.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aduquesn <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2006/06/06 06:06:06 by aduquesn #+# #+# */
/* Updated: 2006/06/06 06:06:06 by aduquesn ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef __MLX_EVENTS_H
# define __MLX_EVENTS_H
/*
** === INPUT EVENTS - APPLE ===
*/
# ifdef __APPLE__
# define MOUSE_L_CLICK 1
# define MOUSE_M_CLICK 3
# define MOUSE_R_CLICK 2
# define MOUSE_SCROLL_UP 4
# define MOUSE_SCROLL_DOWN 5
# define KEY_ESC 0x35
# define KEY_LEFT 0x7B
# define KEY_RIGHT 0x7C
# define KEY_DOWN 0x7D
# define KEY_UP 0x7E
# define KEY_PAGE_UP 0x74
# define KEY_PAGE_DN 0x79
# define KEY_HOME 0x73
# define KEY_END 0x77
# define KEY_HELP 0x72
# define KEY_DELETE 0x75
# define KEY_NUMPAD_0 0x52
# define KEY_NUMPAD_1 0x53
# define KEY_NUMPAD_2 0x54
# define KEY_NUMPAD_3 0x55
# define KEY_NUMPAD_4 0x56
# define KEY_NUMPAD_5 0x57
# define KEY_NUMPAD_6 0x58
# define KEY_NUMPAD_7 0x59
# define KEY_NUMPAD_8 0x5B
# define KEY_NUMPAD_9 0x5C
# define KEY_NUMPAD_PERIOD 0x41
# define KEY_NUMPAD_ENTER 0x4C
# define KEY_NUMPAD_ADD 0x45
# define KEY_NUMPAD_SUB 0x4E
# define KEY_NUMPAD_MUL 0x43
# define KEY_NUMPAD_DIV 0x4B
# define KEY_NUMPAD_CLEAR 0x47
# define KEY_NUMPAD_EQUALS 0x51
/*
** === INPUT EVENTS - WINDOWS ===
*/
# else
# define MOUSE_L_CLICK 1
# define MOUSE_M_CLICK 2
# define MOUSE_R_CLICK 3
# define MOUSE_SCROLL_UP 4
# define MOUSE_SCROLL_DOWN 5
# define KEY_ESC 0xFF1B
# define KEY_LEFT 0xFF51
# define KEY_UP 0xFF52
# define KEY_RIGHT 0xFF53
# define KEY_DOWN 0xFF54
# define KEY_PAGE_UP 0xFF55
# define KEY_PAGE_DN 0xFF56
# define KEY_HOME 0xFF50
# define KEY_END 0xFF57
# define KEY_INSERT 0xFF63
# define KEY_DELETE 0xFFFF
# define KEY_NUMPAD_0 0xFF9E
# define KEY_NUMPAD_1 0xFF9C
# define KEY_NUMPAD_2 0xFF99
# define KEY_NUMPAD_3 0xFF9B
# define KEY_NUMPAD_4 0xFF96
# define KEY_NUMPAD_5 0xFF9D
# define KEY_NUMPAD_6 0xFF98
# define KEY_NUMPAD_7 0xFF95
# define KEY_NUMPAD_8 0xFF97
# define KEY_NUMPAD_9 0xFF9A
# define KEY_NUMPAD_PERIOD 0xFF9F
# define KEY_NUMPAD_ENTER 0xFF8D
# define KEY_NUMPAD_ADD 0xFFAB
# define KEY_NUMPAD_SUB 0xFFAD
# define KEY_NUMPAD_MUL 0xFFAA
# define KEY_NUMPAD_DIV 0xFFAF
# endif
/*
** === EVENT DEFINES ===
*/
# define EVENT_KEYPRESS 2
# define EVENT_KEYRELEASE 3
# define EVENT_BUTTONPRESS 4
# define EVENT_BUTTONRELEASE 5
# define EVENT_MOTIONNOTIFY 6
# define EVENT_ENTERNOTIFY 7
# define EVENT_LEAVENOTIFY 8
# define EVENT_FOCUSIN 9
# define EVENT_FOCUSOUT 10
# define EVENT_KEYMAPNOTIFY 11
# define EVENT_EXPOSE 12
# define EVENT_GRAPHICSEXPOSE 13
# define EVENT_NOEXPOSE 14
# define EVENT_VISIBILITYNOTIFY 15
# define EVENT_CREATENOTIFY 16
# define EVENT_DESTROYNOTIFY 17
# define EVENT_UNMAPNOTIFY 18
# define EVENT_MAPNOTIFY 19
# define EVENT_MAPREQUEST 20
# define EVENT_REPARENTNOTIFY 21
# define EVENT_CONFIGURENOTIFY 22
# define EVENT_CONFIGUREREQUEST 23
# define EVENT_GRAVITYNOTIFY 24
# define EVENT_RESIZEREQUEST 25
# define EVENT_CIRCULATENOTIFY 26
# define EVENT_CIRCULATEREQUEST 27
# define EVENT_PROPERTYNOTIFY 28
# define EVENT_SELECTIONCLEAR 29
# define EVENT_SELECTIONREQUEST 30
# define EVENT_SELECTIONNOTIFY 31
# define EVENT_COLORMAPNOTIFY 32
# define EVENT_CLIENTMESSAGE 33
# define EVENT_MAPPINGNOTIFY 34
# define EVENT_GENERICEVENT 35
# define EVENT_LASTEVENT 36
/*
** === EVENT MASK DEFINES ===
** These are the different X event bit-masks for the X-Server.
** These are not to be confused with event names.
*/
# define MASK_NOEVENT 0L
# define MASK_KEYPRESS (1L<<0)
# define MASK_KEYRELEASE (1L<<1)
# define MASK_BUTTONPRESS (1L<<2)
# define MASK_BUTTONRELEASE (1L<<3)
# define MASK_ENTERWINDOW (1L<<4)
# define MASK_LEAVEWINDOW (1L<<5)
# define MASK_POINTERMOTION (1L<<6)
# define MASK_POINTERMOTIONHINT (1L<<7)
# define MASK_BUTTON1MOTION (1L<<8)
# define MASK_BUTTON2MOTION (1L<<9)
# define MASK_BUTTON3MOTION (1L<<10)
# define MASK_BUTTON4MOTION (1L<<11)
# define MASK_BUTTON5MOTION (1L<<12)
# define MASK_BUTTONMOTION (1L<<13)
# define MASK_KEYMAPSTATE (1L<<14)
# define MASK_EXPOSURE (1L<<15)
# define MASK_VISIBILITYCHANGE (1L<<16)
# define MASK_STRUCTURENOTIFY (1L<<17)
# define MASK_RESIZEREDIRECT (1L<<18)
# define MASK_SUBSTRUCTURENOTIFY (1L<<19)
# define MASK_SUBSTRUCTUREREDIRECT (1L<<20)
# define MASK_FOCUSCHANGE (1L<<21)
# define MASK_PROPERTYCHANGE (1L<<22)
# define MASK_COLORMAPCHANGE (1L<<23)
# define MASK_OWNERGRABBUTTON (1L<<24)
#endif