Source

pyGAP / game / inc / input / win32 / keyboard.h

#ifndef _INPUT_WIN32_KEYBOARD_
#define _INPUT_WIN32_KEYBOARD_

#include "input/keyboard.h"

#include <windows.h>


namespace input {
namespace win32 {


class Keyboard: public input::Keyboard
{
public:
    Keyboard(::HINSTANCE hinstance, unsigned char* key_map);
    ~Keyboard();

    bool is_pressed(int key);

    void update() {}
    int get_value(int index);

    int get_pressed_key();
    int get_key_code(int key);
    void get_key_symbol(int key, char* name);

    static const unsigned char key_code_[128];

private:
    bool is_escaped_key(int key);

    static const unsigned char escaped_key_[17];
    static const unsigned char virtual_key_[input::Keyboard::MAX_KEY];
    static const unsigned char scan_code_[input::Keyboard::MAX_KEY];

    ::HINSTANCE hinstance_;
    unsigned char* key_map_;
};


} // namespace win32
} // namespace input


#endif // _INPUT_WIN32_KEYBOARD_