Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

keyboardinputdevice.cpp

Go to the documentation of this file.
00001 // PTF - Psychological Test Framework 00002 // http://ptf.sourceforge.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 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU Library General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 #include <ptf/input/keyboardinputdevice.hpp> 00019 #include <ptf/core/ptfcore.hpp> 00020 00024 KeyboardInputDevice::KeyboardInputDevice() { 00025 // nothing to do here 00026 } 00030 KeyboardInputDevice::~KeyboardInputDevice() { 00031 // nothing to do here 00032 } 00033 00037 bool KeyboardInputDevice::poll() { 00038 SDL_Event event; 00039 if (SDL_PollEvent(&event)){ 00040 if (event.type == SDL_QUIT){ 00041 PtfCore::getSingleton().getScheduler().quit(); 00042 } 00043 else if (event.type == SDL_KEYDOWN) { 00044 lastKey = event.key.keysym.sym; 00045 return true; 00046 } 00047 } 00048 return false; 00049 } 00050 00192 SDLKey KeyboardInputDevice::getLastKey() const { 00193 return lastKey; 00194 } 00195 00199 bool KeyboardInputDevice::handle(vector<bool>& states) { 00200 return false; 00201 }

Generated on Fri Dec 17 14:54:23 2004 for Psychological Test Framework by doxygen 1.3.8