# Documentation of the MLV-0.6.716 library

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

# MLV_event.h

    00001 /*
    00002  *   This file is part of the MLV Library.
    00003  *
    00004  *   Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
    00005  *
    00006  *
    00007  *    This Library is free software: you can redistribute it and/or modify
    00008  *    it under the terms of the GNU General Public License as published by
    00009  *    the Free Software Foundation, either version 3 of the License, or
    00010  *    (at your option) any later version.
    00011  *
    00012  *    This Library is distributed in the hope that it will be useful,
    00013  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00015  *    GNU General Public License for more details.
    00016  *
    00017  *    You should have received a copy of the GNU General Public License
    00018  *    along with this Library.  If not, see <http://www.gnu.org/licenses/>.
    00019  */
    00020
    00031 #ifndef __MLV__MLV_EVENT_H__
    00032 #define __MLV__MLV_EVENT_H__
    00033
    00034 #include "MLV_device_with_buttons.h"
    00035 #include "MLV_keyboard.h"
    00036 #include "MLV_mouse.h"
    00037 #include "MLV_input_box.h"
    00038
    00039 #ifdef __cplusplus
    00040 extern "C" {
    00041 #endif
    00042
    00046 typedef enum {
    00047         MLV_NONE = 0,
    00048         MLV_KEY = 1,
    00049         MLV_INPUT_BOX = 2,
    00051         MLV_MOUSE_BUTTON = 3,
    00052         MLV_MOUSE_MOTION = 4
    00053 } MLV_Event;
    00054
    00055
    00137 MLV_Event MLV_get_event(
    00138         MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
    00139         char** texte, MLV_Input_box** input_box,
    00140         int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
    00141         MLV_Button_state* state
    00142 );
    00143
    00144
    00145
    00187 MLV_Event MLV_wait_event(
    00188         MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
    00189         char** texte, MLV_Input_box** input_box,
    00190         int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
    00191         MLV_Button_state* state
    00192 );
    00193
    00194
    00240 MLV_Event MLV_wait_event_or_seconds(
    00241         MLV_Keyboard_button* key_sym, MLV_Keyboard_modifier* key_mod, int* unicode,
    00242         char** texte, MLV_Input_box** input_box,
    00243         int* mouse_x, int* mouse_y, MLV_Mouse_button* mouse_button,
    00244         MLV_Button_state* state, int seconds
    00245 );
    00246
    00247
    00248
    00253 void MLV_flush_event_queue();
    00254
    00286 MLV_Event MLV_wait_keyboard_or_mouse(
    00287         MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
    00288         int* mouse_x, int* mouse_y
    00289 );
    00290
    00291
    00318 MLV_Event MLV_wait_keyboard_or_mouse_or_seconds(
    00319         MLV_Keyboard_button* sym, MLV_Keyboard_modifier* mod, int* unicode,
    00320         int* mouse_x, int* mouse_y,
    00321         int seconds
    00322 );
    00323
    00330 const char* MLV_convert_event_to_string( MLV_Event event_code );
    00331
    00338 MLV_Event MLV_convert_string_to_event( const char* event_string );
    00339
    00346 const char* MLV_convert_button_state_to_string( MLV_Button_state state_code );
    00347
    00354 MLV_Button_state MLV_convert_string_to_button_state( const char* state_string );
    00355
    00356 #ifdef __cplusplus
    00357 }
    00358 #endif
    00359
    00360 #endif
    00361