taisei/src/events.h

57 lines
938 B
C
Raw Normal View History

2012-08-13 17:50:28 +02:00
/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
2012-08-13 17:50:28 +02:00
* ---
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
* Copyright (C) 2012, Alexeyew Andrew <http://akari.thebadasschoobs.org/>
*/
#ifndef EVENTS_H
#define EVENTS_H
typedef enum {
EF_Keyboard = 1,
EF_Text = 2,
EF_Menu = 4,
EF_Game = 8,
EF_Gamepad = 16
2012-08-13 17:50:28 +02:00
} EventFlags;
typedef enum {
// EF_Keyboard
E_KeyDown,
E_KeyUp,
2012-08-13 17:50:28 +02:00
// EF_Text
E_CharTyped,
E_CharErased,
E_SubmitText,
E_CancelText,
2012-08-13 17:50:28 +02:00
// EF_Menu
E_CursorUp,
E_CursorDown,
E_CursorLeft,
E_CursorRight,
E_MenuAccept,
E_MenuAbort,
2012-08-13 17:50:28 +02:00
// EF_Game
E_PlrKeyDown,
E_PlrKeyUp,
2012-08-15 16:36:39 +02:00
E_PlrAxisUD,
E_PlrAxisLR,
E_Pause,
// EF_Gamepad
E_GamepadKeyDown,
2017-02-27 23:58:47 +01:00
E_GamepadKeyUp,
E_GamepadAxis,
E_GamepadAxisValue,
2012-08-13 17:50:28 +02:00
} EventType;
typedef void(*EventHandler)(EventType, int, void*);
void handle_events(EventHandler handler, EventFlags flags, void *arg);
#endif