annotate Keyboard.cpp @ 44:916bec351934

22.10.12(pCurrentScreen)
author Ritor1
date Mon, 22 Oct 2012 17:28:15 +0600
parents 8b8875f5b359
children 8b0c4d626477
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "OSAPI.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Keyboard.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "OSInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 struct KeyboardActionMapping *pKeyActionMap;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 struct AsyncKeyboard *pAsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 //----- (00459C68) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 void KeyboardActionMapping::SetKeyMapping(int uAction, int vKey, KeyToggleType type)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 pVirtualKeyCodesMapping[uAction] = vKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 pToggleTypes[uAction] = type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 //----- (00459C82) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 unsigned int KeyboardActionMapping::GetActionVKey(enum InputAction eAction)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 return this->pVirtualKeyCodesMapping[eAction];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 //----- (00459C8D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 KeyboardActionMapping::KeyboardActionMapping()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 uLastKeyPressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 SetDefaultMapping();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 ReadMappings();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 dword_506E68 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 // 506E68: using guessed type int dword_506E68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 //----- (00459CC4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 void KeyboardActionMapping::SetDefaultMapping()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 pVirtualKeyCodesMapping[0] = VK_UP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 pToggleTypes[0] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 pVirtualKeyCodesMapping[1] = VK_DOWN;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 pToggleTypes[1] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 pVirtualKeyCodesMapping[2] = VK_LEFT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 pToggleTypes[2] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 pVirtualKeyCodesMapping[3] = VK_RIGHT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 pToggleTypes[3] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 pVirtualKeyCodesMapping[8] = 'A';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 pToggleTypes[8] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 pVirtualKeyCodesMapping[7] = 'S';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 pToggleTypes[7] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 pVirtualKeyCodesMapping[4] = 'Y';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 pToggleTypes[4] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 pVirtualKeyCodesMapping[5] = 'X';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 pToggleTypes[5] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 pVirtualKeyCodesMapping[6] = VK_RETURN;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 pToggleTypes[6] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 pVirtualKeyCodesMapping[9] = VK_SPACE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 pToggleTypes[9] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 pVirtualKeyCodesMapping[10] = 'C';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 pToggleTypes[10] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 pVirtualKeyCodesMapping[11] = 'B';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 pToggleTypes[11] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 pVirtualKeyCodesMapping[12] = VK_TAB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 pToggleTypes[12] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 pVirtualKeyCodesMapping[13] = 'Q';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 pToggleTypes[13] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 pVirtualKeyCodesMapping[14] = 'Z';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 pToggleTypes[14] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 pVirtualKeyCodesMapping[15] = 'R';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 pToggleTypes[15] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 pVirtualKeyCodesMapping[16] = 'T';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 pToggleTypes[16] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 pVirtualKeyCodesMapping[17] = 'N';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 pToggleTypes[17] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 pVirtualKeyCodesMapping[18] = 'M';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 pToggleTypes[18] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 pVirtualKeyCodesMapping[20] = VK_NEXT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 pToggleTypes[20] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 pVirtualKeyCodesMapping[21] = VK_DELETE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 pToggleTypes[21] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 SetKeyMapping(INPUT_CenterView, VK_END, TOGGLE_Continuously);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 SetKeyMapping(INPUT_ZoomIn, VK_ADD, TOGGLE_OneTimePress);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 SetKeyMapping(INPUT_ZoomOut, VK_SUBTRACT, TOGGLE_OneTimePress);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 SetKeyMapping(INPUT_FlyUp, VK_PRIOR, TOGGLE_Continuously);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 SetKeyMapping(INPUT_FlyDown, VK_INSERT, TOGGLE_Continuously);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 SetKeyMapping(INPUT_Land, VK_HOME, TOGGLE_OneTimePress);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 SetKeyMapping(INPUT_AlwaysRun, 'U', TOGGLE_OneTimePress);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 SetKeyMapping(INPUT_StrafeLeft, VK_OEM_4, TOGGLE_Continuously);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 SetKeyMapping(INPUT_StrafeRight, VK_OEM_6, TOGGLE_Continuously);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 //----- (00459E3F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 void KeyboardActionMapping::ResetKeys()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 for (uint i = 0; i < 30; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 GetAsyncKeyState(pVirtualKeyCodesMapping[i]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 //----- (00459E5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 void KeyboardActionMapping::_459E5A(int a2, int a3, GUIWindow *pWindow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 KeyboardActionMapping *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 memset(this->pPressedKeysBuffer, 0, 0x101u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 v4->uNumKeysPressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 v4->field_204 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 v4->field_204 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v4->field_FC = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 v4->pWindow = pWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 pWindow->field_40 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 if ( pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 //----- (00459ED1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 void KeyboardActionMapping::_459ED1(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 KeyboardActionMapping *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 GUIWindow *v3; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 v2->field_204 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 v3 = v2->pWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 v3->field_40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 //----- (00459F10) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 bool KeyboardActionMapping::_459F10(unsigned int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 int v3; // [sp-4h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 pKeyActionMap->uLastKeyPressed = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 if ( dword_506E68 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 if ( pKeyActionMap->field_204 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 if ( a2 != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 if ( a2 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 if ( a2 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 goto LABEL_3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 if ( a2 == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 if ( this->uNumKeysPressed >= this->field_FC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 ++pKeyActionMap->uNumKeysPressed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 if ( pKeyActionMap->field_204 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 if ( a2 != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 if ( a2 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 goto LABEL_3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 if ( a2 != 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 if ( (signed int)a2 >= 48 && (signed int)a2 <= 57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 if ( pKeyActionMap->uNumKeysPressed < this->field_FC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 ++pKeyActionMap->uNumKeysPressed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 v3 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 goto LABEL_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 if ( !pKeyActionMap->uNumKeysPressed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 --pKeyActionMap->uNumKeysPressed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 ++pKeyActionMap->uNumKeysPressed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 LABEL_3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 LABEL_4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 pKeyActionMap->_459ED1(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 // 506E68: using guessed type int dword_506E68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 //----- (00459FFC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 void KeyboardActionMapping::ReadMappings()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 //KeyboardActionMapping *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 unsigned int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 unsigned int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 int v8; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 unsigned int v9; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 int v10; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 unsigned int v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 //unsigned int v13; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 int v14; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 //unsigned int v15; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 int v16; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 //unsigned int v17; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 int v18; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 //unsigned int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 int v20; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 //unsigned int v21; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 int v22; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 //unsigned int v23; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 int v24; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 //unsigned int v25; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 int v26; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 //unsigned int v27; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 int v28; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 //unsigned int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 //unsigned int v31; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 int v32; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 //unsigned int v33; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 int v34; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 //unsigned int v35; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 int v36; // eax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 //unsigned int v37; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 int v38; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 //unsigned int v39; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 int v40; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 //unsigned int v41; // eax@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 int v42; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 //unsigned int v43; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 int v44; // eax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 //unsigned int v45; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 int v46; // eax@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 //unsigned int v47; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 int v48; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 //unsigned int v49; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 int v50; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 //unsigned int v51; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 int v52; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 //unsigned int v53; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 int v54; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 //unsigned int v55; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 int v56; // eax@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 unsigned int v57; // eax@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 int v58; // eax@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 unsigned int v59; // eax@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 int v60; // eax@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 unsigned int v61; // eax@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 //char str[32]; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 char str[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 ReadWindowsRegistryString("KEY_FORWARD", str, 32, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 if ( strcmp(str, "DEFAULT") && (LOBYTE(v2) = GetActionDefaultVKey(str), v2 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 pVirtualKeyCodesMapping[0] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 pVirtualKeyCodesMapping[0] = VK_UP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 pToggleTypes[0] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 ReadWindowsRegistryString("KEY_BACKWARD", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 if ( strcmp(str, "DEFAULT") && (LOBYTE(v4) = GetActionDefaultVKey(str), v4 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 pVirtualKeyCodesMapping[1] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 pVirtualKeyCodesMapping[1] = VK_DOWN;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 pToggleTypes[1] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 ReadWindowsRegistryString("KEY_LEFT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 if ( strcmp(str, "DEFAULT") && (LOBYTE(v6) = GetActionDefaultVKey(str), v6 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 pVirtualKeyCodesMapping[2] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 pVirtualKeyCodesMapping[2] = VK_LEFT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 pToggleTypes[2] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 ReadWindowsRegistryString("KEY_RIGHT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 if ( strcmp(str, "DEFAULT") && (LOBYTE(v8) = GetActionDefaultVKey(str), v8 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 pVirtualKeyCodesMapping[3] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 pVirtualKeyCodesMapping[3] = VK_RIGHT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 pToggleTypes[3] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 ReadWindowsRegistryString("KEY_ATTACK", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 if ( strcmp(str, "DEFAULT") && (LOBYTE(v10) = GetActionDefaultVKey(str), v10 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 pVirtualKeyCodesMapping[8] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 pVirtualKeyCodesMapping[8] = 'A';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 pToggleTypes[8] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 ReadWindowsRegistryString("KEY_CASTREADY", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 if ( strcmp(str, "DEFAULT") && (LOBYTE(v12) = GetActionDefaultVKey(str), v12 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 pVirtualKeyCodesMapping[7] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 pVirtualKeyCodesMapping[7] = 'S';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 pToggleTypes[7] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 ReadWindowsRegistryString("KEY_YELL", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 if ( strcmp(str, "DEFAULT") && (LOBYTE(v14) = GetActionDefaultVKey(str), v14 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 pVirtualKeyCodesMapping[4] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 pVirtualKeyCodesMapping[4] = 'Y';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 pToggleTypes[4] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 ReadWindowsRegistryString("KEY_JUMP", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 if ( strcmp(str, "DEFAULT") && (LOBYTE(v16) = GetActionDefaultVKey(str), v16 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 pVirtualKeyCodesMapping[5] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 pVirtualKeyCodesMapping[5] = 'X';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 pToggleTypes[5] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 ReadWindowsRegistryString("KEY_COMBAT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 if ( strcmp(str, "DEFAULT") && (LOBYTE(v18) = GetActionDefaultVKey(str), v18 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 pVirtualKeyCodesMapping[6] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 pVirtualKeyCodesMapping[6] = VK_RETURN;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 pToggleTypes[6] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 ReadWindowsRegistryString("KEY_EVENTTRIGGER", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 if ( strcmp(str, "DEFAULT") && (LOBYTE(v20) = GetActionDefaultVKey(str), v20 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 pVirtualKeyCodesMapping[9] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 pVirtualKeyCodesMapping[9] = VK_SPACE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 pToggleTypes[9] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 ReadWindowsRegistryString("KEY_CAST", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 if ( strcmp(str, "DEFAULT") && (LOBYTE(v22) = GetActionDefaultVKey(str), v22 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 pVirtualKeyCodesMapping[10] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 pVirtualKeyCodesMapping[10] = 'C';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 pToggleTypes[10] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 ReadWindowsRegistryString("KEY_PASS", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 if ( strcmp(str, "DEFAULT") && (LOBYTE(v24) = GetActionDefaultVKey(str), v24 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 pVirtualKeyCodesMapping[11] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 pVirtualKeyCodesMapping[11] = 'B';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 pToggleTypes[11] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 ReadWindowsRegistryString("KEY_CHARCYCLE", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 if ( strcmp(str, "DEFAULT") && (LOBYTE(v26) = GetActionDefaultVKey(str), v26 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 pVirtualKeyCodesMapping[12] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 pVirtualKeyCodesMapping[12] = VK_TAB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 pToggleTypes[12] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 ReadWindowsRegistryString("KEY_QUEST", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 if ( strcmp(str, "DEFAULT") && (LOBYTE(v28) = GetActionDefaultVKey(str), v28 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 pVirtualKeyCodesMapping[13] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 pVirtualKeyCodesMapping[13] = 'Q';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 pToggleTypes[13] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 ReadWindowsRegistryString("KEY_QUICKREF", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 if ( strcmp(str, "DEFAULT") && (LOBYTE(v30) = GetActionDefaultVKey(str), v30 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 pVirtualKeyCodesMapping[14] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 pVirtualKeyCodesMapping[14] = 'Z';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 pToggleTypes[14] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 ReadWindowsRegistryString("KEY_REST", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 if ( strcmp(str, "DEFAULT") && (LOBYTE(v32) = GetActionDefaultVKey(str), v32 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 pVirtualKeyCodesMapping[15] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 pVirtualKeyCodesMapping[15] = 'R';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 pToggleTypes[15] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 ReadWindowsRegistryString("KEY_TIMECAL", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 if ( strcmp(str, "DEFAULT") && (LOBYTE(v34) = GetActionDefaultVKey(str), v34 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 pVirtualKeyCodesMapping[16] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 pVirtualKeyCodesMapping[16] = 'T';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 pToggleTypes[16] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 ReadWindowsRegistryString("KEY_AUTONOTES", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 if ( strcmp(str, "DEFAULT") && (LOBYTE(v36) = GetActionDefaultVKey(str), v36 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 pVirtualKeyCodesMapping[17] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 pVirtualKeyCodesMapping[17] = 'N';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 pToggleTypes[17] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 ReadWindowsRegistryString("KEY_MAPBOOK", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 if ( strcmp(str, "DEFAULT") && (LOBYTE(v38) = GetActionDefaultVKey(str), v38 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 pVirtualKeyCodesMapping[18] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 pVirtualKeyCodesMapping[18] = 'M';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 pToggleTypes[18] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 ReadWindowsRegistryString("KEY_LOOKUP", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 if ( strcmp(str, "DEFAULT") && (LOBYTE(v40) = GetActionDefaultVKey(str), v40 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 pVirtualKeyCodesMapping[20] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 pVirtualKeyCodesMapping[20] = VK_NEXT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 pToggleTypes[20] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 ReadWindowsRegistryString("KEY_LOOKDOWN", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 if ( strcmp(str, "DEFAULT") && (LOBYTE(v42) = GetActionDefaultVKey(str), v42 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 pVirtualKeyCodesMapping[21] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 pVirtualKeyCodesMapping[21] = VK_DELETE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 pToggleTypes[21] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 ReadWindowsRegistryString("KEY_CENTERVIEWPT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 if ( strcmp(str, "DEFAULT") && (LOBYTE(v44) = GetActionDefaultVKey(str), v44 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 pVirtualKeyCodesMapping[22] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 pVirtualKeyCodesMapping[22] = VK_END;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 pToggleTypes[22] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 ReadWindowsRegistryString("KEY_ZOOMIN", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 if ( strcmp(str, "DEFAULT") && (LOBYTE(v46) = GetActionDefaultVKey(str), v46 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 pVirtualKeyCodesMapping[23] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 pVirtualKeyCodesMapping[23] = VK_ADD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 pToggleTypes[23] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 ReadWindowsRegistryString("KEY_ZOOMOUT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 if ( strcmp(str, "DEFAULT") && (LOBYTE(v48) = GetActionDefaultVKey(str), v48 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 pVirtualKeyCodesMapping[24] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 pVirtualKeyCodesMapping[24] = VK_SUBTRACT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 pToggleTypes[24] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 ReadWindowsRegistryString("KEY_FLYUP", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 if ( strcmp(str, "DEFAULT") && (LOBYTE(v50) = GetActionDefaultVKey(str), v50 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 pVirtualKeyCodesMapping[25] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 pVirtualKeyCodesMapping[25] = VK_PRIOR;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 pToggleTypes[25] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 ReadWindowsRegistryString("KEY_FLYDOWN", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 if ( strcmp(str, "DEFAULT") && (LOBYTE(v52) = GetActionDefaultVKey(str), v52 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 pVirtualKeyCodesMapping[26] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 pVirtualKeyCodesMapping[26] = VK_INSERT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 pToggleTypes[26] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 ReadWindowsRegistryString("KEY_LAND", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 if ( strcmp(str, "DEFAULT") && (LOBYTE(v54) = GetActionDefaultVKey(str), v54 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 pVirtualKeyCodesMapping[27] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 pVirtualKeyCodesMapping[27] = VK_HOME;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 pToggleTypes[27] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 ReadWindowsRegistryString("KEY_ALWAYSRUN", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 if ( strcmp(str, "DEFAULT") && (LOBYTE(v56) = GetActionDefaultVKey(str), v56 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 pVirtualKeyCodesMapping[19] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 pVirtualKeyCodesMapping[19] = 'U';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 pToggleTypes[19] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 bAlwaysRun = ReadWindowsRegistryInt("valAlwaysRun", 0) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 bFlipOnExit = ReadWindowsRegistryInt("FlipOnExit", 0) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 ReadWindowsRegistryString("KEY_STEPLEFT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 if ( strcmp(str, "DEFAULT") && (LOBYTE(v58) = GetActionDefaultVKey(str), v58 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 pVirtualKeyCodesMapping[28] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 pToggleTypes[28] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 pToggleTypes[28] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 pVirtualKeyCodesMapping[28] = VK_OEM_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 ReadWindowsRegistryString("KEY_STEPRIGHT", str, 0x20u, "DEFAULT");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 if ( strcmp(str, "DEFAULT") && (LOBYTE(v60) = GetActionDefaultVKey(str), v60 != -1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 pVirtualKeyCodesMapping[29] = GetActionDefaultVKey(str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 pToggleTypes[29] = TOGGLE_OneTimePress;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 pToggleTypes[29] = TOGGLE_Continuously;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 pVirtualKeyCodesMapping[29] = VK_OEM_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 //----- (0045A960) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 void KeyboardActionMapping::StoreMappings()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 const char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 const char *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 const char *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 const char *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 const char *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 const char *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 const char *v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 const char *v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 const char *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 const char *v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 const char *v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 const char *v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 const char *v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 const char *v15; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 const char *v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 const char *v17; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 const char *v18; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 const char *v19; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 const char *v20; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 const char *v21; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 const char *v22; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 const char *v23; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 const char *v24; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 const char *v25; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 const char *v26; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 const char *v27; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 const char *v28; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 const char *v29; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 v2 = GetVKeyDisplayName(this->pVirtualKeyCodesMapping[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 WriteWindowsRegistryString("KEY_FORWARD", v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 v3 = GetVKeyDisplayName(pVirtualKeyCodesMapping[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 WriteWindowsRegistryString("KEY_BACKWARD", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 v4 = GetVKeyDisplayName(pVirtualKeyCodesMapping[2]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 WriteWindowsRegistryString("KEY_LEFT", v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 v5 = GetVKeyDisplayName(pVirtualKeyCodesMapping[3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 WriteWindowsRegistryString("KEY_RIGHT", v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 v6 = GetVKeyDisplayName(pVirtualKeyCodesMapping[8]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 WriteWindowsRegistryString("KEY_ATTACK", v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 v7 = GetVKeyDisplayName(pVirtualKeyCodesMapping[7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 WriteWindowsRegistryString("KEY_CASTREADY", v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 v8 = GetVKeyDisplayName(pVirtualKeyCodesMapping[4]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 WriteWindowsRegistryString("KEY_YELL", v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 v9 = GetVKeyDisplayName(pVirtualKeyCodesMapping[5]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 WriteWindowsRegistryString("KEY_JUMP", v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 v10 = GetVKeyDisplayName(pVirtualKeyCodesMapping[6]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 WriteWindowsRegistryString("KEY_COMBAT", v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 v11 = GetVKeyDisplayName(pVirtualKeyCodesMapping[9]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 WriteWindowsRegistryString("KEY_EVENTTRIGGER", v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 v12 = GetVKeyDisplayName(pVirtualKeyCodesMapping[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 WriteWindowsRegistryString("KEY_CAST", v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 v13 = GetVKeyDisplayName(pVirtualKeyCodesMapping[11]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 WriteWindowsRegistryString("KEY_PASS", v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 v14 = GetVKeyDisplayName(pVirtualKeyCodesMapping[12]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 WriteWindowsRegistryString("KEY_CHARCYCLE", v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 v15 = GetVKeyDisplayName(pVirtualKeyCodesMapping[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 WriteWindowsRegistryString("KEY_QUEST", v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 v16 = GetVKeyDisplayName(pVirtualKeyCodesMapping[14]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 WriteWindowsRegistryString("KEY_QUICKREF", v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 v17 = GetVKeyDisplayName(pVirtualKeyCodesMapping[15]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 WriteWindowsRegistryString("KEY_REST", v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 v18 = GetVKeyDisplayName(pVirtualKeyCodesMapping[16]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 WriteWindowsRegistryString("KEY_TIMECAL", v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 v19 = GetVKeyDisplayName(pVirtualKeyCodesMapping[17]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 WriteWindowsRegistryString("KEY_AUTONOTES", v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 v20 = GetVKeyDisplayName(pVirtualKeyCodesMapping[18]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 WriteWindowsRegistryString("KEY_MAPBOOK", v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 v21 = GetVKeyDisplayName(pVirtualKeyCodesMapping[20]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 WriteWindowsRegistryString("KEY_LOOKUP", v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 v22 = GetVKeyDisplayName(pVirtualKeyCodesMapping[21]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 WriteWindowsRegistryString("KEY_LOOKDOWN", v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 v23 = GetVKeyDisplayName(pVirtualKeyCodesMapping[22]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 WriteWindowsRegistryString("KEY_CENTERVIEWPT", v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 v24 = GetVKeyDisplayName(pVirtualKeyCodesMapping[23]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 WriteWindowsRegistryString("KEY_ZOOMIN", v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 v25 = GetVKeyDisplayName(pVirtualKeyCodesMapping[24]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 WriteWindowsRegistryString("KEY_ZOOMOUT", v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 v26 = GetVKeyDisplayName(pVirtualKeyCodesMapping[25]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 WriteWindowsRegistryString("KEY_FLYUP", v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 v27 = GetVKeyDisplayName(pVirtualKeyCodesMapping[26]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 WriteWindowsRegistryString("KEY_FLYDOWN", v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 v28 = GetVKeyDisplayName(pVirtualKeyCodesMapping[27]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 WriteWindowsRegistryString("KEY_LAND", v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 v29 = GetVKeyDisplayName(pVirtualKeyCodesMapping[19]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 WriteWindowsRegistryString("KEY_ALWAYSRUN", v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 //----- (0045ABCA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 const unsigned __int8 KeyboardActionMapping::GetActionDefaultVKey(const char *Str)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 unsigned __int8 result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 if ( !strcmp(Str, "UP") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 return VK_UP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 if ( !strcmp(Str, "DOWN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 return VK_DOWN;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 if ( !strcmp(Str, ascii_4E2D48) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 return VK_LEFT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 if ( !strcmp(Str, ascii_4E2D40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 return VK_RIGHT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 if ( !strcmp(Str, "RETURN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 return VK_RETURN;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 if ( !strcmp(Str, "SPACE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 return VK_SPACE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 if ( !strcmp(Str, "PAGE_DOWN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 return VK_NEXT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 if ( !strcmp(Str, "PAGE_UP") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 return VK_PRIOR;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 if ( !strcmp(Str, "TAB") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 return VK_TAB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 if ( !strcmp(Str, "SUBTRACT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 return VK_SUBTRACT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 if ( !strcmp(Str, "ADD") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 return VK_ADD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 if ( !strcmp(Str, "END") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 return VK_END;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 if ( !strcmp(Str, "DELETE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 return VK_DELETE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 if ( !strcmp(Str, "HOME") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 return VK_HOME;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 if ( !strcmp(Str, "INSERT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 return VK_INSERT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 if ( strcmp(Str, "COMMA") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 if ( !strcmp(Str, "DECIMAL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 return VK_DECIMAL;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 if ( strcmp(Str, "SEMICOLON") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 if ( strcmp(Str, "PERIOD") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 if ( strcmp(Str, "SLASH") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 if ( strcmp(Str, "SQUOTE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 if ( strcmp(Str, "BACKSLASH") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 if ( !strcmp(Str, "BACKSPACE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 return VK_BACK;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 if ( !strcmp(Str, "CONTROL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 return VK_CONTROL;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 if ( strlen(Str) != 1 || (result = *Str, (unsigned __int8)*Str < 0x41u) || result > 0x5Au )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 result = -36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 result = -34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 result = -65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 result = -66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 result = -70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 result = -68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 //----- (0045AE2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 const char *KeyboardActionMapping::GetVKeyDisplayName(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 char *v3; // [sp-4h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 static char static_sub_45AE2C_string_69ADE0[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 if ( a1 == VK_UP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 v3 = "UP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 strcpy(static_sub_45AE2C_string_69ADE0, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 return static_sub_45AE2C_string_69ADE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 if ( a1 == VK_DOWN )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 v3 = "DOWN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 if ( a1 == VK_LEFT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 v3 = ascii_4E2D48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 if ( a1 == VK_RIGHT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 v3 = ascii_4E2D40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 if ( a1 == VK_RETURN )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 v3 = "RETURN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 if ( a1 == VK_SPACE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 v3 = "SPACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 if ( a1 == VK_NEXT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 v3 = "PAGE_DOWN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 if ( a1 == VK_PRIOR )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v3 = "PAGE_UP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 if ( a1 == VK_TAB )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 v3 = "TAB";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 if ( a1 == 'm' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 v3 = "SUBTRACT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 if ( a1 == 'k' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 v3 = "ADD";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 if ( a1 == VK_END )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 v3 = "END";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 if ( a1 == VK_DELETE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 v3 = "DELETE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 if ( a1 == VK_HOME )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 v3 = "HOME";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 if ( a1 == VK_INSERT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 v3 = "INSERT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 if ( a1 == VK_DECIMAL )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 v3 = "DECIMAL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 if ( a1 == VK_OEM_COMMA )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 v3 = "COMMA";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 if ( a1 == VK_OEM_1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 v3 = "SEMICOLON";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 if ( a1 == VK_OEM_PERIOD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 v3 = "PERIOD";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 if ( a1 == VK_OEM_2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 v3 = "SLASH";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 if ( a1 == VK_OEM_7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v3 = "SQUOTE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 if ( a1 == VK_OEM_5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 v3 = "BACKSLASH";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 if ( a1 == VK_CONTROL )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 v3 = "CONTROL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 if ( a1 == VK_BACK )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 v3 = "BACKSPACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 if ( a1 < 65 || a1 > 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 v3 = "-ÍÅÒ -";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 *(unsigned short *)static_sub_45AE2C_string_69ADE0 = (unsigned __int8)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 return static_sub_45AE2C_string_69ADE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 //----- (0045AFD9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 Keyboard::Keyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 bUsingAsynKeyboard = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 if (pVersion->pVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 pVersion->pVersionInfo.dwMajorVersion == 4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 bUsingAsynKeyboard = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 //----- (0045B019) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 void Keyboard::EnterCriticalSection()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 if (bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 AsyncKeyboard::EnterCriticalSection();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 //----- (0045B06E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 bool Keyboard::IsShiftHeld()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 char v2; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 if (bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 if ( pAsyncKeyboard->_45B4EC(0x2Au) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 v2 = pAsyncKeyboard->_45B4EC(0x36u) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 LOWORD(result) = GetAsyncKeyState(VK_SHIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 v2 = result == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 LOBYTE(result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 //----- (0045B0A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 bool Keyboard::IsKeyBeingHeld(int vKey)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 void *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 char v3; // bl@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 if (bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v2 = pAsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v3 = *((unsigned char *)v2 + (unsigned __int8)AsyncKeyboard::map_key(v2, vKey) + 265) >> 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 return v3;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 return (GetAsyncKeyState(vKey) & 0x8001) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 //----- (0045B0CE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 bool Keyboard::WasKeyPressed(int vKey)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 void *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 char v3; // bl@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 if ( LOBYTE(this->bUsingAsynKeyboard) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 /*v2 = pAsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 v3 = *((unsigned char *)v2 + (unsigned __int8)AsyncKeyboard::map_key(v2, vKey) + 521) >> 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 LOBYTE(result) = v3;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 LOWORD(result) = GetAsyncKeyState(vKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 LOBYTE(result) = result & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 //----- (0045B10A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 AsyncKeyboard::AsyncKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 *(unsigned int *)(this + 4) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 *(unsigned char *)(this + 8) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 if (!Initialize())
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 MessageBoxW(nullptr, L"Could not initialize asynchronos keyboard object", nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 // 4D86B8: using guessed type int (__stdcall *AsyncKeyboard_pvdtor)(char);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 // 4DBD94: using guessed type int dword_4DBD94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 //----- (0045B15E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 AsyncKeyboard::~AsyncKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 v2 = (char *)this + 1804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 v3 = *((unsigned int *)this + 451);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 (**(void (__stdcall ***)(unsigned int))v3)(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 *(unsigned int *)v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 return TerminateThread(*((HANDLE *)v1 + 1), 0x1F4u);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 // 4D86B8: using guessed type int (__stdcall *AsyncKeyboard_pvdtor)(char);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 //----- (0045B18E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 bool AsyncKeyboard::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 _45B1B1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 if (_45B229())
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 return CreateDirectInputKeyboard() != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 //----- (0045B1B1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 void AsyncKeyboard::_45B1B1()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 memset((char *)this + 9, 0, 0x100u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 memset((char *)v1 + 265, 0, 0x100u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 memset((char *)v1 + 521, 0, 0x100u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 memset((char *)v1 + 780, 0, 0x400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 //----- (0045B1FD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 void AsyncKeyboard::EnterCriticalSection()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 //EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 //----- (0045B213) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 void AsyncKeyboard::LeaveCriticalSection()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 //LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 //----- (0045B229) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 char AsyncKeyboard::_45B229()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 /*void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 DWORD ThreadId; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 ThreadId = (DWORD)this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v2 = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)AsyncKeyboardThread, this, 4u, &ThreadId);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 *((unsigned int *)v1 + 1) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 result = SetThreadPriority(v2, 15) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 //----- (0045B260) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 char AsyncKeyboard::CreateDirectInputKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 /*v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v2 = new DirectInputKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 *((void **)v1 + 451) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 return v2 != 0;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 //----- (0045B2A7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 void AsyncKeyboard::Resume()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 /*void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 std::string v2; // [sp-18h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 const char *v3; // [sp-8h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 int v4; // [sp-4h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 std::string *v5; // [sp+4h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 int a3; // [sp+Bh] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 if ( *((unsigned int *)this + 451) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 _45B1B1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 DirectInputKeyboard::set_acquire(*((DirectInputKeyboard **)v1 + 451), (int *)1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 ResumeThread(*((HANDLE *)v1 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 MessageBoxW(nullptr, L"Invalid DI_Keyboard, bailing out of resume()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\KeyboardAsync.cpp:97", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 //----- (0045B329) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 void AsyncKeyboard::Suspend()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 /*void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 std::string v2; // [sp-18h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 const char *v3; // [sp-8h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 int v4; // [sp-4h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 std::string *v5; // [sp+4h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 int a3; // [sp+Bh] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 if ( *((unsigned int *)this + 451) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 SuspendThread(*((HANDLE *)v1 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 DirectInputKeyboard::set_acquire(*((DirectInputKeyboard **)v1 + 451), 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 MessageBoxW(nullptr, L"Invalid DI_Keyboard, bailing out of suspend()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\KeyboardAsync.cpp:115", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 //----- (0045B3A4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 char AsyncKeyboard::_45B3A4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 /**((unsigned char *)this + 8) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 Sleep(0x85u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 return 1;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 //----- (00465C53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 void AsyncKeyboard::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 /*if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 if ( pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 if ( pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 (**(void (__stdcall ***)(int))pAsyncKeyboard)(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 pAsyncKeyboard = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 //----- (0045B3B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 void AsyncKeyboard::Thread()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 /*void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 signed int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 DWORD v4; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 std::string v5; // [sp-18h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 const char *v6; // [sp-8h] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 int v7; // [sp-4h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 DWORD v8; // [sp+Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 int a3; // [sp+13h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 if ( *((unsigned int *)this + 451) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 ::EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 v8 = timeGetTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 memcpy((char *)v1 + 9, (const void *)(*((unsigned int *)v1 + 451) + 29), 0x100u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 (*((DirectInputKeyboard **)v1 + 451)->_43B8EC();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 memcpy((char *)v1 + 265, (const void *)(*((unsigned int *)v1 + 451) + 29), 0x100u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 v3 = (int)((char *)v1 + 780);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 if ( *((unsigned char *)v1 + v2 + 265) & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 if ( v8 - *(unsigned int *)v3 > 0xC8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 v4 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 *((unsigned char *)v1 + v2 + 521) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 *(unsigned int *)v3 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 v3 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 while ( v2 < 256 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 ::LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 MessageBoxW(nullptr, L"Invalid DI_Keyboard, bailing out of update_keyboard_data()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\KeyboardAsync.cpp:169", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 //----- (0045B4EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 char AsyncKeyboard::_45B4EC(unsigned __int8 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 /*void *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 char v3; // bl@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v3 = *((unsigned char *)v2 + a2 + 265) >> 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncKeyboard);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 return v3;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 //----- (0045B57D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 char AsyncKeyboard::map_key(int key)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 /*char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 std::string v3; // [sp-18h] [bp-1Ch]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 const char *v4; // [sp-8h] [bp-Ch]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 int v5; // [sp-4h] [bp-8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 void *v6; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 switch ( key )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 result = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 result = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 result = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 case 161:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 result = 54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 case 160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 result = 42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 case 163:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 result = -99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 case 162:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 result = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 result = -72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 result = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 result = 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 result = -108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 case 27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 case 28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 result = 121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 result = 123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 result = 57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 case 33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 result = -55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 case 34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 result = -47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 case 35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 result = -49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 result = -57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 case 37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 result = -53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 result = -56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 result = -51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 case 40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 result = -48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 case 42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 result = -73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 case 45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 result = -46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 case 46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 result = -45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 case 48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 result = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 case 49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 result = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 case 50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 result = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 result = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 case 52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 result = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 case 53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 result = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 case 54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 result = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 case 55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 result = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 case 56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 result = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 case 57:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 result = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 case 65:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 result = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 case 66:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 result = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 case 67:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 result = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 case 68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 result = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 case 69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 result = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 case 70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 result = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 case 71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 result = 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 case 72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 result = 35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 case 73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 result = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 case 74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 result = 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 case 75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 result = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 case 76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 result = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 case 77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 result = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 case 78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 result = 49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 case 79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 result = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 case 80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 result = 25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 case 81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 result = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 case 82:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 result = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 case 83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 result = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 case 84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 result = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 case 85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 result = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 case 86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 result = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 case 87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 result = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 case 88:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 result = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 case 89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 result = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 case 90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 result = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 case 91:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 result = -37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 case 92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 result = -36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 case 93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 result = -35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 case 96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 result = 82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 case 97:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 result = 79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 case 98:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 result = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 case 99:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 result = 81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 case 100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 result = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 case 101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 result = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 result = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 result = 71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 result = 72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 case 105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 result = 73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 case 106:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 result = 55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 case 107:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 result = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 case 109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 result = 74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 case 110:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 result = 83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 case 111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 result = -75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 case 112:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 result = 59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 case 113:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 result = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 case 114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 result = 61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 case 115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 result = 62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 case 116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 result = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 case 117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 result = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 case 118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 result = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 case 119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 result = 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 case 120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 result = 67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 case 121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 result = 68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 case 122:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 result = 87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 case 123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 result = 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 case 124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 result = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 case 125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 result = 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 case 126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 result = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 case 144:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 result = 69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 case 145:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 result = 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 MessageBoxW(nullptr, L"Uknown key detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\KeyboardAsync.cpp:999", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 case 31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 case 44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 case 47:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 case 108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 case 127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 case 128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 case 129:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 case 130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 case 131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 case 132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 case 133:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 case 134:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 case 135:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 LABEL_100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 //----- (0045BA60) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 int __stdcall AsyncKeyboard::ThreadStarter(AsyncKeyboard *pInstance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 /*while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 while ( !pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 if ( *((unsigned char *)pAsyncKeyboard + 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 ExitThread(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 pAsyncKeyboard->Thread();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 Sleep(0x21u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 //----- (0043B76D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 DirectInputKeyboard *__thiscall DirectInputKeyboard::DirectInputKeyboard(DirectInputKeyboard *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 DirectInputKeyboard *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 HRESULT v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 unsigned int uVersion; // [sp-18h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 IDirectInput **ppDirectInput; // [sp-14h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 int v6; // [sp-10h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 const char *v7; // [sp-Ch] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 int v8; // [sp-8h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 unsigned int v9; // [sp-4h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 CheckHRESULT_stru0 v10; // [sp+4h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 this->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 LOBYTE(this->field_1C) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 this->vdestructor_ptr = &pDirectInputKeyboard_pvdtor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 v8 = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 ppDirectInput = &this->pDirectInput;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 uVersion = 0x500u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 v8 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 ppDirectInput = &this->pDirectInput;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 uVersion = 0x300u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 v2 = DirectInputCreateA(hInstance, uVersion, ppDirectInput, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 CheckHRESULT(&v10, v2, v7, v8, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 DirectInputKeyboard::CreateDevice(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 DirectInputKeyboard::43B87B(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 // 4C8880: using guessed type int __stdcall DirectInputCreateA(int, int, int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 //----- (0043B7E3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 void __thiscall DirectInputKeyboard::vdtor(DirectInputKeyboard *this, bool a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 void *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 DirectInputKeyboard::dtor(this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 if ( a2 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 //----- (0043B7FF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 void __thiscall DirectInputKeyboard::dtor(DirectInputKeyboard *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 DirectInputKeyboard *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 v2 = this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 this->vdestructor_ptr = &pDirectInputKeyboard_pvdtor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 (*(void (__stdcall **)(int))(*(int *)v2 + 32))(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 (*(void (__stdcall **)(int))(*(int *)v1->field_8 + 8))(v1->field_8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 v1->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 v1->pDirectInput->lpVtbl->Release(v1->pDirectInput);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 v1->pDirectInput = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 //----- (0043B831) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 void __thiscall DirectInputKeyboard::CreateDevice(DirectInputKeyboard *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 DirectInputKeyboard *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 HRESULT v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 int v3; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 v2 = ((int (__stdcall *)(IDirectInput *, signed int, int (__stdcall *)(int, int), DirectInputKeyboard *, signed int))this->pDirectInput->lpVtbl->field_10)(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 this->pDirectInput,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 DirectInputKeyboard_enumerator_43B9B9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 CheckHRESULT((CheckHRESULT_stru0 *)&v3, v2, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp", 52, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 if ( !LOBYTE(v1->field_1C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 v3 = (int)"Error: No keyboard found";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 _CxxThrowException((int)&v3, (int)&dword_4DBD94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 // 43B9B9: using guessed type int __stdcall DirectInputKeyboard_enumerator_43B9B9(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 // 4DBD94: using guessed type int dword_4DBD94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 //----- (0043B87B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 void __thiscall DirectInputKeyboard::43B87B(DirectInputKeyboard *ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 HRESULT v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 HRESULT v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 HRESULT v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 unsigned int v5; // [sp+0h] [bp-Ch]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 char this; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 v1 = (char *)&ecx0->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 v2 = ((int (__stdcall *)(IDirectInput *, int *, int *, int, int))ecx0->pDirectInput->lpVtbl->field_C)(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 ecx0->pDirectInput,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 &ecx0->field_C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 &ecx0->field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 CheckHRESULT((CheckHRESULT_stru0 *)&this, v2, (const char *)0x3C, 1, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v3 = (*(int (__stdcall **)(int, int))(**(int **)v1 + 44))(*(int *)v1, dword_4C9890);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 CheckHRESULT((CheckHRESULT_stru0 *)&this, v3, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp", 63, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v4 = (*(int (__stdcall **)(int, HWND, signed int))(**(int **)v1 + 52))(*(int *)v1, hWnd, 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 CheckHRESULT((CheckHRESULT_stru0 *)&this, v4, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp", 64, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 (*(void (__cdecl **)(int))(**(int **)v1 + 28))(*(int *)v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 // 4C9890: using guessed type int dword_4C9890[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 //----- (0043B8EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 char __thiscall DirectInputKeyboard::43B8EC(DirectInputKeyboard *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 DirectInputKeyboard *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 char *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 HRESULT v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 std::string v7; // [sp-18h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 int v8; // [sp-Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 const char *v9; // [sp-8h] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 int v10; // [sp-4h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 std::string *v13; // [sp+Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 int a3; // [sp+13h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 v2 = this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 v4 = (char *)&this->field_1C + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 if ( (*(int (__stdcall **)(int, signed int, char *))(*(int *)v2 + 36))(v2, 256, (char *)&this->field_1C + 1) == -2147024866 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 if ( !(*(int (__stdcall **)(int))(*(int *)v1->field_8 + 28))(v1->field_8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 v5 = v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 v9 = (const char *)79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 v8 = (int)"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 v6 = (*(int (__stdcall **)(int, signed int, char *))(*(int *)v5 + 36))(v5, 256, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 CheckHRESULT((CheckHRESULT_stru0 *)&v13, v6, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp", 79, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 MessageBoxW(nullptr, L"Invalid Device pointer, bailing out of update_data()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp:72", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 //----- (0043B96E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 char __thiscall DirectInputKeyboard::set_acquire(DirectInputKeyboard *this, int *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 std::string v5; // [sp-18h] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 const char *v6; // [sp-8h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 int v7; // [sp-4h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 DirectInputKeyboard *v8; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 v8 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 v2 = this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 v4 = *(int *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 v7 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 if ( (char)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 (*(void (__stdcall **)(int))(v4 + 28))(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 (*(void (__stdcall **)(int))(v4 + 32))(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 MessageBoxW(nullptr, L"Invalid Device pointer, bailing out of set_acquire()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputKeyboard.cpp:89", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 //----- (0043B9B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 signed int __stdcall DirectInputKeyboard_enumerator_43B9B9(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 if ( *(char *)(a1 + 36) & 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 *(int *)(a2 + 12) = *(int *)(a1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 *(int *)(a2 + 16) = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 *(int *)(a2 + 20) = *(int *)(a1 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 *(int *)(a2 + 24) = *(int *)(a1 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 *(char *)(a2 + 28) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 // 43B9B9: using guessed type int __stdcall DirectInputKeyboard_enumerator_43B9B9(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 */