46 lines
893 B
C++
46 lines
893 B
C++
/* -----------------------------------------------------------------------------
|
|
GSFramework
|
|
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
|
----------------------------------------------------------------------------- */
|
|
|
|
|
|
#ifndef __KEYBOARD_INPUT__
|
|
#define __KEYBOARD_INPUT__
|
|
|
|
|
|
#include "input/input_device.h"
|
|
|
|
|
|
namespace GS {
|
|
namespace Input {
|
|
|
|
/*
|
|
@short Keyboard input device.
|
|
@author Emmanuel Julien (ejulien@nworks.fr)
|
|
*/
|
|
class Keyboard : public Device
|
|
{
|
|
protected:
|
|
|
|
bool is_down[Key_Last],
|
|
was_down[Key_Last];
|
|
|
|
public:
|
|
|
|
virtual Type GetType() const { return Type_Keyboard; }
|
|
virtual const char *GetName() const { return "Keyboard"; }
|
|
|
|
virtual void Update() = 0;
|
|
|
|
virtual bool IsDown(KeyCode k) const { return is_down[k]; }
|
|
virtual bool WasDown(KeyCode k) const { return was_down[k]; }
|
|
|
|
Keyboard();
|
|
};
|
|
|
|
} // Input
|
|
} // GS
|
|
|
|
|
|
#endif // __KEYBOARD_INPUT__
|