1 #include "Common\WinCommon.h"
2 #include "KeyboardHelper.h"
4 // TODO: This is essentially the same as the GTK code - should probably share them a little more
6 CKeyboardHelper::CKeyboardHelper() {
7 // TODO: Hard code the mappings for now, but eventually make these
8 // configurable (at which point we shouldn't need to know about the
18 m_mTable
[0x41] = 1; //a
19 m_mTable
[0x53] = 3; // s
20 m_mTable
[0x57] = 2;// w
21 m_mTable
[0x5a] = 4;// z
25 m_mTable
[0x4a] = 1; // j
26 m_mTable
[0x4b] = 3; // k
27 m_mTable
[0x49] = 2; // i
28 m_mTable
[0x4d] = 4; // m
32 m_mTable
[VK_LEFT
] = 1;
33 m_mTable
[VK_RIGHT
] = 3;
35 m_mTable
[VK_DOWN
] = 4;
37 // Arrows on numeric keypad
39 m_mTable
[VK_NUMPAD4
] = 1;
40 m_mTable
[VK_NUMPAD6
] = 3;
41 m_mTable
[VK_NUMPAD8
] = 2;
42 m_mTable
[VK_NUMPAD2
] = 4;
46 m_mTable
[0x31] = 1; // 11
47 m_mTable
[0x32] = 2; // 2
48 m_mTable
[0x33] = 3; // 3
49 m_mTable
[0x34] = 4; // 4
51 // 0 = keyboard start/stop
53 m_mTable
[VK_SPACE
] = 0;
56 int CKeyboardHelper::ConvertKeyCode(int iCode
) {
57 std::map
<int, int>::iterator
it(m_mTable
.find(iCode
));
59 if(it
== m_mTable
.end())