![]() |
Unuk 1.0
|
00001 #ifndef _INPUT_H_ 00002 #define _INPUT_H_ 00003 #include <SDL/SDL.h> 00004 00005 typedef struct mouse_s { 00006 int dx, dy; 00007 int oldx, oldy; 00008 unsigned int buttons; 00009 unsigned int oldButtons; 00010 } mouse_t; 00011 00012 typedef struct keyboard_s { 00013 unsigned char *keys; 00014 unsigned char *oldKeys; 00015 int keycount; 00016 int lastChar; 00017 unsigned int mods; 00018 } keyboard_t; 00019 00020 typedef struct input_s { 00021 mouse_t mouse; 00022 keyboard_t keyboard; 00023 } input_t; 00024 00025 bool CreateInput(void); 00026 void UpdateInput(void); 00027 00028 char GetKey(void); 00029 00030 unsigned int GetX(void); 00031 unsigned int GetY(void); 00032 unsigned int GetOldX(void); 00033 unsigned int GetOldY(void); 00034 unsigned int GetMods(void); 00035 bool KeyDown(int index); 00036 bool KeyStillDown(int index); 00037 bool KeyUp(int index); 00038 bool KeyStillUp(int index); 00039 bool MouseDown(int button); 00040 bool MouseStillDown(int button); 00041 bool MouseUp(int button); 00042 bool MouseStillUp(int button); 00043 00044 void DestroyInput(void); 00045 00046 #endif