00001 /* 00002 * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 */ 00009 #include "DemoInput.h" 00010 00011 #include "Keymap.h" 00012 #include "KeyDesc.h" 00013 #include "GameState.h" 00014 00015 //----------------------------------------------------------------- 00016 /** 00017 * Create demo input handler. 00018 * Escape, space or mouse click quit state. 00019 * @param demo pointer to the leader 00020 */ 00021 DemoInput::DemoInput(GameState *demo) 00022 : GameInput(demo) 00023 { 00024 KeyDesc key_quit(KEY_QUIT, "quit"); 00025 m_keymap->registerKey(KeyStroke(SDLK_SPACE, KMOD_NONE), key_quit); 00026 } 00027 //----------------------------------------------------------------- 00028 void 00029 DemoInput::mouseEvent(const MouseStroke &/*buttons*/) 00030 { 00031 quitState(); 00032 } 00033