Main Page   Packages   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals  

KeyboardEvent.cpp

Go to the documentation of this file.
00001 /*
00002  * $Id: KeyboardEvent.cpp,v 1.2 2002/07/22 03:04:53 virtualcasino Exp $
00003  */
00004 #include<KeyboardEvent.h>
00005 #include<SDL/SDL.h>
00006 
00007 namespace clawsoft{
00008 
00009         KeyboardEvent::KeyboardEvent(){
00010                 setClassName("KeyboardEvent");
00011         }
00012 
00013         bool KeyboardEvent::keyPressed(int keysym){
00014                 Uint8 *keystate;
00015                 bool ret;
00016                 eM.lock();
00017                         keystate = SDL_GetKeyState(0);
00018                         SDL_PumpEvents();
00019                         if(keystate[keysym] == 1)
00020                                 ret = true;
00021                         else
00022                                 ret = false;
00023                 eM.unlock();
00024                 return ret;
00025         }
00026 
00027 
00028 }

Powered by:

SourceForge Logo