Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef INPUT_H__
00028 #define INPUT_H__
00029
00030 #include "types.h"
00031 #include "SDL_keysym.h"
00032
00033
00034
00035
00036
00037
00038
00039
00040 class input
00041 {
00042 public:
00043
00044
00045
00046
00047
00048 static void init();
00049
00050
00051
00052
00053
00054 static void shutdown();
00055
00056
00057
00058
00059
00060 static void update();
00061
00062
00063
00064
00065
00066
00067
00068
00069 static bool is_pushed(SDLKey key);
00070
00071
00072
00073
00074
00075
00076
00077
00078 static bool has_been_pushed(SDLKey key);
00079
00080
00081
00082
00083
00084
00085
00086
00087 static s_int32 get_next_key();
00088
00089
00090
00091
00092
00093
00094
00095 static s_int32 get_next_unicode();
00096
00097
00098
00099
00100
00101
00102
00103 static void set_key_repeat(int delay=SDL_DEFAULT_REPEAT_DELAY, int interval=SDL_DEFAULT_REPEAT_INTERVAL);
00104
00105
00106
00107
00108
00109 static void clear_keys_queue();
00110
00111
00112 private:
00113 static u_int16 last_key;
00114
00115 static int filterevents(const SDL_Event *event);
00116
00117 static u_int16 mouse_posx, mouse_posy;
00118 static u_int8 * keystate;
00119 static u_int8 * p_keystate;
00120 static s_int32 keystatelength;
00121 #ifndef SWIG
00122 static bool mouse_button[3];
00123 #endif
00124
00125 };
00126
00127 #endif