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

mouseinputdevice.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/mouseinputdevice.hpp> 00019 #include <ptf/core/ptfcore.hpp> 00020 #include <SDL.h> 00021 00025 MouseInputDevice::MouseInputDevice() { 00026 SDL_ShowCursor(0); 00027 // nothing to do here 00028 } 00029 00033 MouseInputDevice::~MouseInputDevice() { 00034 // nothing to do here 00035 } 00036 00041 bool MouseInputDevice::poll() { 00042 SDL_Event event; 00043 if (SDL_PollEvent(&event)){ 00044 if (event.type == SDL_QUIT){ 00045 PtfCore::getSingleton().getScheduler().quit(); 00046 } 00047 else if (event.type == SDL_MOUSEBUTTONDOWN) { 00048 lastButton = event.button.button; 00049 return true; 00050 } 00051 } 00052 return false; 00053 } 00054 00061 int MouseInputDevice::getLastButton() const { 00062 return lastButton; 00063 } 00064 00068 bool MouseInputDevice::handle(vector<bool>& states) { 00069 return false; 00070 }

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