-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeySetSystem.cpp
More file actions
81 lines (72 loc) · 1.84 KB
/
KeySetSystem.cpp
File metadata and controls
81 lines (72 loc) · 1.84 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include "stdafx.h"
#include "KeySet_Test.h"
#include "KeySetSystem.h"
KeySetManager::KeySetManager()
{
m_nTotalTime = 0;
}
void KeySetManager::KeyEvent(int nKeyCode, int nKeyType)
{
}
void KeySetManager::Tick(int nTime)
{
if(!m_strKeySeq.empty())
{
//GetKeyState()
}
ShowKeySeqText();
}
char* KeySetManager::GetVirtualKey(int nKeyCode)
{
switch(nKeyCode)
{
case KeyUp:
return "8";
case KeyDown:
return "2";
case KeyLeft:
return "4";
case KeyRight:
return "6";
case KeyA:
return "A";
case KeyB:
return "B";
}
return "-";
}
void KeySetManager::ShowKeySeqText()
{
//wchar_t * wc = new wchar_t[str.size()];
//swprintf(wc,L"%S",str.c_str()); //注意大写S。
RECT rect;
TCHAR *buf = new TCHAR[m_strKeySeq.size()+1];
swprintf_s(buf,m_strKeySeq.size()+1,L"%S",m_strKeySeq.c_str());
GetClientRect (g_hWnd, &rect) ;
//rect.top = long(rect.bottom*0.5);
rect.right = long(rect.right);
rect.bottom = long(rect.bottom);
OutPutText(g_hWnd,buf,rect);
delete buf;
}
void KeySetManager::InitVirtualKeyList()
{
m_VirKeyList.push_back(new KeyState(VK_UP,false));
m_VirKeyList.push_back(new KeyState(VK_DOWN,false));
m_VirKeyList.push_back(new KeyState(VK_LEFT,false));
m_VirKeyList.push_back(new KeyState(VK_RIGHT,false));
m_VirKeyList.push_back(new KeyState(VK_NUMPAD1,false));
m_VirKeyList.push_back(new KeyState(VK_NUMPAD2,false));
}
void KeySetManager::InitAllKeySequence()
{
//以八神A键相关技能距离
m_AllKeySequence.push_back(new SkillKey("A"));
m_AllKeySequence.push_back(new SkillKey("6A"));
m_AllKeySequence.push_back(new SkillKey("26A"));//暗勾手
m_AllKeySequence.push_back(new SkillKey("62A"));//葵花
m_AllKeySequence.push_back(new SkillKey("426A"));//抓
m_AllKeySequence.push_back(new SkillKey("626A"));//升龙
m_AllKeySequence.push_back(new SkillKey("2624A"));//八稚女
m_AllKeySequence.push_back(new SkillKey("2426A"));//八酒杯
}