-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeyManager.h
More file actions
40 lines (28 loc) · 758 Bytes
/
keyManager.h
File metadata and controls
40 lines (28 loc) · 758 Bytes
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
#pragma once
#include "singletonBase.h"
#include <bitset> //0과 1 그 비트 입니다
#define KEYMAX 256
using namespace std;
class keyManager : public singletonBase<keyManager>
{
private:
bitset<KEYMAX> _keyUp;
bitset<KEYMAX> _keyDown;
public:
keyManager();
~keyManager();
HRESULT init();
void release();
//키를 누르면
bool isOnceKeyDown(int key);
//키를 떼면
bool isOnceKeyUp(int key);
//키를 누르고 있으면
bool isStayKeyDown(int key);
//키를 토글하면 (캡스락이나 넘락 같은거)
bool isToggleKey(int key);
bitset<KEYMAX> getKeyUp() { return _keyUp; }
bitset<KEYMAX> getKeyDown() { return _keyDown; }
void setKeyDown(int key, bool state) { _keyDown.set(key, state); }
void setKeyUp(int key, bool state) { _keyUp.set(key, state); }
};