# Documentation of the MLV-2.0.2 library

- Presentation
- Downloads
- Installation
- Compilation
- Examples
- API
- List of functions
- bugs
- FAQ
- contacts

MLV_event.h
1 /*
2 * This file is part of the MLV Library.
3 *
4 * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5 *
6 *
7 * This Library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This Library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
31 #ifndef __MLV__MLV_EVENT_H__
32 #define __MLV__MLV_EVENT_H__
33
34 #include "MLV_device_with_buttons.h"
35 #include "MLV_keyboard.h"
36 #include "MLV_mouse.h"
37 #include "MLV_input_box.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
46 typedef enum {
47 MLV_NONE = 0,
48 MLV_KEY = 1,
49 MLV_INPUT_BOX = 2,
51 MLV_MOUSE_BUTTON = 3,
52 MLV_MOUSE_MOTION = 4
53 } MLV_Event;
54
55
137 MLV_Event MLV_get_event(
138 MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
139 char** texte, MLV_Input_box** input_box,
140 int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
141 MLV_Button_state* state
142 );
143
144
145
187 MLV_Event MLV_wait_event(
188 MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
189 char** texte, MLV_Input_box** input_box,
190 int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
191 MLV_Button_state* state
192 );
193
194
240 MLV_Event MLV_wait_event_or_seconds(
241 MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
242 char** texte, MLV_Input_box** input_box,
243 int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
244 MLV_Button_state* state, int seconds
245 );
246
247
248
253 void MLV_flush_event_queue();
254
286 MLV_Event MLV_wait_keyboard_or_mouse(
287 MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
288 int* mouse_x, int* mouse_y
289 );
290
291
318 MLV_Event MLV_wait_keyboard_or_mouse_or_seconds(
319 MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
320 int* mouse_x, int* mouse_y,
321 int seconds
322 );
323
330 const char* MLV_convert_event_to_string( MLV_Event event_code );
331
338 MLV_Event MLV_convert_string_to_event( const char* event_string );
339
346 const char* MLV_convert_button_state_to_string( MLV_Button_state state_code );
347
354 MLV_Button_state MLV_convert_string_to_button_state( const char* state_string );
355
356 #ifdef __cplusplus
357 }
358 #endif
359
360 #endif
361