Removed unused members of class CKey.

This commit is contained in:
Guillaume Melquiond 2009-10-10 16:19:51 +00:00
parent be32933321
commit c5d5b1efd4
2 changed files with 13 additions and 26 deletions

View file

@ -16,19 +16,6 @@
#include "key.hpp"
CKey::CKey() :
key_list(0),
is_enabled(true)
key_list(SDL_GetKeyState(NULL))
{
static int num_keys = 300;
key_list = SDL_GetKeyState( &num_keys );
}
int CKey::operator[]( int code ) const
{
return int(key_list[code]);
}
void CKey::SetEnabled( bool enable )
{
is_enabled = enable;
}

View file

@ -17,20 +17,20 @@
#include "SDL.h"
//object which keeps track of all the keys on the keyboard, and
//whether any key is pressed or not can be found by using its
//operator[]. Note though that it is generally better to use
//key events to see when keys are pressed rather than poll using
//this object.
class CKey {
/**
* Class that keeps track of all the keys on the keyboard.
* Whether any key is pressed or not can be found by using its
* operator[]. Note though that it is generally better to use
* key events to see when keys are pressed rather than to poll using
* this object.
*/
class CKey
{
Uint8 *key_list;
public:
CKey();
int operator[](int) const;
void SetEnabled(bool enable);
private:
Uint8 *key_list;
bool is_enabled;
bool operator[](int k) const { return key_list[k]; }
};
#endif