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 "PedoInput.h" 00010 00011 #include "Pedometer.h" 00012 #include "Keymap.h" 00013 00014 #include "KeyStroke.h" 00015 #include "MouseStroke.h" 00016 00017 //----------------------------------------------------------------- 00018 PedoInput::PedoInput(Pedometer *pedometer) 00019 : GameInput(pedometer) 00020 { 00021 } 00022 //----------------------------------------------------------------- 00023 Pedometer * 00024 PedoInput::getPedo() 00025 { 00026 return dynamic_cast<Pedometer*>(m_state); 00027 } 00028 //----------------------------------------------------------------- 00029 void 00030 PedoInput::mouseEvent(const MouseStroke &buttons) 00031 { 00032 if (buttons.isLeft()) { 00033 getPedo()->runSelected(); 00034 } 00035 } 00036