00001 #ifndef HEADER_STATEINPUT_H 00002 #define HEADER_STATEINPUT_H 00003 00004 class Keymap; 00005 class GameState; 00006 00007 #include "InputHandler.h" 00008 00009 /** 00010 * Handle input for game state. 00011 */ 00012 class StateInput : public InputHandler { 00013 protected: 00014 static const int KEY_QUIT = 1; 00015 static const int KEY_CONSOLE = 2; 00016 static const int KEY_HELP = 3; 00017 static const int KEY_MENU = 4; 00018 static const int KEY_SUBTITLES = 5; 00019 Keymap *m_keymap; 00020 GameState *m_state; 00021 protected: 00022 virtual void quitState(); 00023 virtual void enableConsole(); 00024 virtual void enableHelp() {}; 00025 virtual void enableMenu() {}; 00026 virtual void enableSubtitles(); 00027 virtual void specStroke(const KeyStroke &/*stroke*/) {} 00028 virtual void specKey(int keyIndex); 00029 void toggleParam(const std::string ¶m); 00030 public: 00031 StateInput(GameState *state); 00032 ~StateInput(); 00033 00034 virtual void keyEvent(const KeyStroke &stroke); 00035 }; 00036 00037 #endif