forked from hedgar2017/loki-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeyboard.h
40 lines (28 loc) · 974 Bytes
/
keyboard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "device.h"
#include <Windows.h>
#include "keys.h"
class Keyboard : public Device
{
public:
explicit Keyboard();
Keyboard(const Keyboard &) = delete;
void operator =(const Keyboard &) = delete;
virtual ~Keyboard() override = default;
virtual void initialize() override;
virtual void type(BYTE keyCode);
virtual void abort() override;
protected:
BYTE m_modifiers {KEY_NONE};
static const BYTE REPORT_ID {0x04};
private:
#pragma pack(1)
struct Report {
BYTE reportId;
BYTE modifiers;
BYTE _reserved;
BYTE keyCodes[6];
};
#pragma pack()
virtual void sendKeyboardReport(BYTE *keyCodes);
};