2010-12-04 16:14:34 +00:00
|
|
|
|
/********************************************************
|
|
|
|
|
* Keyboard.h *
|
|
|
|
|
* *
|
|
|
|
|
* XFX Keyboard definition file *
|
|
|
|
|
* Copyright <EFBFBD> XFX Team. All Rights Reserved *
|
|
|
|
|
********************************************************/
|
|
|
|
|
#ifndef _XFX_INPUT_KEYBOARD_
|
|
|
|
|
#define _XFX_INPUT_KEYBOARD_
|
|
|
|
|
|
|
|
|
|
#include "Enums.h"
|
|
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
|
{
|
|
|
|
|
namespace Input
|
|
|
|
|
{
|
2012-09-28 20:36:02 +00:00
|
|
|
|
// Represents a state of keystrokes recorded by a keyboard input device.
|
2010-12-04 16:14:34 +00:00
|
|
|
|
struct KeyboardState
|
|
|
|
|
{
|
|
|
|
|
KeyboardState();
|
2010-12-27 01:01:25 +00:00
|
|
|
|
KeyboardState(Keys_t keys[]);
|
|
|
|
|
KeyboardState(const KeyboardState &obj);
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
2010-12-27 01:01:25 +00:00
|
|
|
|
Keys_t* GetPressedKeys();
|
|
|
|
|
bool IsKeyDown(Keys_t key);
|
|
|
|
|
bool IsKeyUp(Keys_t key);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Keys_t* pressedKeys;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
2012-09-28 20:36:02 +00:00
|
|
|
|
// Allows retrieval of keystrokes from a keyboard input device.
|
2010-12-04 16:14:34 +00:00
|
|
|
|
class Keyboard
|
|
|
|
|
{
|
2010-12-27 01:01:25 +00:00
|
|
|
|
private:
|
|
|
|
|
Keyboard(); //Private constructor to prevent instantiation.
|
|
|
|
|
|
2010-12-04 16:14:34 +00:00
|
|
|
|
public:
|
|
|
|
|
static KeyboardState GetState();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //_XFX_INPUT_KEYBOARD_
|