00001 #ifndef __INPUT_H
00002 #define __INPUT_H
00003
00004
00005
00006 #define PLAYER_KEY_LEFT SDLK_LEFT
00007 #define PLAYER_KEY_RIGHT SDLK_RIGHT
00008 #define PLAYER_KEY_UP SDLK_UP
00009 #define PLAYER_KEY_DOWN SDLK_DOWN
00010 #define PLAYER_KEY_FIRE_1 SDLK_LCTRL
00011 #define PLAYER_KEY_FIRE_2 SDLK_LALT
00012 #define PLAYER_BUTTON_FIRE_1 0 // joystick / gamepad
00013 #define PLAYER_BUTTON_FIRE_2 1 // joystick / gamepad
00014
00015 #define KEY_EXIT SDLK_ESCAPE
00016 #define KEY_FULLSCREEN SDLK_f
00017 #define KEY_WINDOWED SDLK_w
00018
00019 #define KEY_1_QUICK_PASS SDLK_LALT
00020 #define KEY_2_QUICK_PASS SDLK_q
00021
00022 #define INPUT_RIGHT 1
00023 #define INPUT_DOWN 2
00024 #define INPUT_LEFT 4
00025 #define INPUT_UP 8
00026 #define INPUT_FIRE 16
00027 #define INPUT_BOMB 32
00028
00029 class Input
00030 {
00031 private:
00032 Uint8* keys;
00033 SDL_Joystick* joystick;
00034 bool pressed( int );
00035 int axis( int );
00036 int button( int );
00037
00038 public:
00039 Input();
00040 ~Input();
00041 void RefreshState();
00042 int State();
00043 void WaitForKey();
00044 void DisplayInfoWithEffect( Effect *effect, Display *display,
00045 list<string> info );
00046 };
00047
00048 #endif