annotate Keyboard.cpp @ 2029:81a0e6819d3f

Слияние
author Ritor1
date Mon, 18 Nov 2013 10:07:24 +0600
parents c1c74df0a33e
children d44b7775fc06
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1038
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1038
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1038
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1038
diff changeset
4
0
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6 #include "Keyboard.h"
Ritor1
parents:
diff changeset
7 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
8 #include "Game.h"
Ritor1
parents:
diff changeset
9 #include "OSInfo.h"
Ritor1
parents:
diff changeset
10
Ritor1
parents:
diff changeset
11 #include "mm7_data.h"
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
12 #include "Vis.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
13 #include "MM7.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
14 #include "Actor.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
15 #include "DecorationList.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
16 #include "Indoor.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
17 #include "viewport.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
18 #include "AudioPlayer.h"
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1459
diff changeset
19 #include "Level/Decoration.h"
0
Ritor1
parents:
diff changeset
20
Ritor1
parents:
diff changeset
21
Ritor1
parents:
diff changeset
22 struct KeyboardActionMapping *pKeyActionMap;
Ritor1
parents:
diff changeset
23 struct AsyncKeyboard *pAsyncKeyboard;
Ritor1
parents:
diff changeset
24
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29 //----- (00459C68) --------------------------------------------------------
Ritor1
parents:
diff changeset
30 void KeyboardActionMapping::SetKeyMapping(int uAction, int vKey, KeyToggleType type)
Ritor1
parents:
diff changeset
31 {
Ritor1
parents:
diff changeset
32 pVirtualKeyCodesMapping[uAction] = vKey;
Ritor1
parents:
diff changeset
33 pToggleTypes[uAction] = type;
Ritor1
parents:
diff changeset
34 }
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36 //----- (00459C82) --------------------------------------------------------
Ritor1
parents:
diff changeset
37 unsigned int KeyboardActionMapping::GetActionVKey(enum InputAction eAction)
Ritor1
parents:
diff changeset
38 {
Ritor1
parents:
diff changeset
39 return this->pVirtualKeyCodesMapping[eAction];
Ritor1
parents:
diff changeset
40 }
Ritor1
parents:
diff changeset
41
Ritor1
parents:
diff changeset
42 //----- (00459C8D) --------------------------------------------------------
Ritor1
parents:
diff changeset
43 KeyboardActionMapping::KeyboardActionMapping()
Ritor1
parents:
diff changeset
44 {
Ritor1
parents:
diff changeset
45 uLastKeyPressed = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 164
diff changeset
46 field_204 = 0;
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 271
diff changeset
47 pWindow = nullptr;
0
Ritor1
parents:
diff changeset
48
Ritor1
parents:
diff changeset
49 SetDefaultMapping();
Ritor1
parents:
diff changeset
50 ReadMappings();
Ritor1
parents:
diff changeset
51
Ritor1
parents:
diff changeset
52 ResetKeys();
Ritor1
parents:
diff changeset
53
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
54 uGameMenuUI_CurentlySelectedKeyIdx = -1;
0
Ritor1
parents:
diff changeset
55 }
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
56 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
0
Ritor1
parents:
diff changeset
57
Ritor1
parents:
diff changeset
58 //----- (00459CC4) --------------------------------------------------------
Ritor1
parents:
diff changeset
59 void KeyboardActionMapping::SetDefaultMapping()
Ritor1
parents:
diff changeset
60 {
Ritor1
parents:
diff changeset
61 pVirtualKeyCodesMapping[0] = VK_UP;
Ritor1
parents:
diff changeset
62 pToggleTypes[0] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
63 pVirtualKeyCodesMapping[1] = VK_DOWN;
Ritor1
parents:
diff changeset
64 pToggleTypes[1] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
65 pVirtualKeyCodesMapping[2] = VK_LEFT;
Ritor1
parents:
diff changeset
66 pToggleTypes[2] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
67 pVirtualKeyCodesMapping[3] = VK_RIGHT;
Ritor1
parents:
diff changeset
68 pToggleTypes[3] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
69 pVirtualKeyCodesMapping[8] = 'A';
Ritor1
parents:
diff changeset
70 pToggleTypes[8] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
71 pVirtualKeyCodesMapping[7] = 'S';
Ritor1
parents:
diff changeset
72 pToggleTypes[7] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
73 pVirtualKeyCodesMapping[4] = 'Y';
Ritor1
parents:
diff changeset
74 pToggleTypes[4] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
75 pVirtualKeyCodesMapping[5] = 'X';
Ritor1
parents:
diff changeset
76 pToggleTypes[5] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
77 pVirtualKeyCodesMapping[6] = VK_RETURN;
Ritor1
parents:
diff changeset
78 pToggleTypes[6] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
79 pVirtualKeyCodesMapping[9] = VK_SPACE;
Ritor1
parents:
diff changeset
80 pToggleTypes[9] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
81 pVirtualKeyCodesMapping[10] = 'C';
Ritor1
parents:
diff changeset
82 pToggleTypes[10] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
83 pVirtualKeyCodesMapping[11] = 'B';
Ritor1
parents:
diff changeset
84 pToggleTypes[11] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
85 pVirtualKeyCodesMapping[12] = VK_TAB;
Ritor1
parents:
diff changeset
86 pToggleTypes[12] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
87 pVirtualKeyCodesMapping[13] = 'Q';
Ritor1
parents:
diff changeset
88 pToggleTypes[13] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
89 pVirtualKeyCodesMapping[14] = 'Z';
Ritor1
parents:
diff changeset
90 pToggleTypes[14] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
91 pVirtualKeyCodesMapping[15] = 'R';
Ritor1
parents:
diff changeset
92 pToggleTypes[15] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
93 pVirtualKeyCodesMapping[16] = 'T';
Ritor1
parents:
diff changeset
94 pToggleTypes[16] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
95 pVirtualKeyCodesMapping[17] = 'N';
Ritor1
parents:
diff changeset
96 pToggleTypes[17] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
97 pVirtualKeyCodesMapping[18] = 'M';
Ritor1
parents:
diff changeset
98 pToggleTypes[18] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
99 pVirtualKeyCodesMapping[20] = VK_NEXT;
Ritor1
parents:
diff changeset
100 pToggleTypes[20] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
101 pVirtualKeyCodesMapping[21] = VK_DELETE;
Ritor1
parents:
diff changeset
102 pToggleTypes[21] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
103
Ritor1
parents:
diff changeset
104 SetKeyMapping(INPUT_CenterView, VK_END, TOGGLE_Continuously);
Ritor1
parents:
diff changeset
105 SetKeyMapping(INPUT_ZoomIn, VK_ADD, TOGGLE_OneTimePress);
Ritor1
parents:
diff changeset
106 SetKeyMapping(INPUT_ZoomOut, VK_SUBTRACT, TOGGLE_OneTimePress);
Ritor1
parents:
diff changeset
107 SetKeyMapping(INPUT_FlyUp, VK_PRIOR, TOGGLE_Continuously);
Ritor1
parents:
diff changeset
108 SetKeyMapping(INPUT_FlyDown, VK_INSERT, TOGGLE_Continuously);
Ritor1
parents:
diff changeset
109 SetKeyMapping(INPUT_Land, VK_HOME, TOGGLE_OneTimePress);
Ritor1
parents:
diff changeset
110 SetKeyMapping(INPUT_AlwaysRun, 'U', TOGGLE_OneTimePress);
Ritor1
parents:
diff changeset
111 SetKeyMapping(INPUT_StrafeLeft, VK_OEM_4, TOGGLE_Continuously);
Ritor1
parents:
diff changeset
112 SetKeyMapping(INPUT_StrafeRight, VK_OEM_6, TOGGLE_Continuously);
Ritor1
parents:
diff changeset
113 }
Ritor1
parents:
diff changeset
114
Ritor1
parents:
diff changeset
115 //----- (00459E3F) --------------------------------------------------------
Ritor1
parents:
diff changeset
116 void KeyboardActionMapping::ResetKeys()
Ritor1
parents:
diff changeset
117 {
Ritor1
parents:
diff changeset
118 for (uint i = 0; i < 30; ++i)
Ritor1
parents:
diff changeset
119 GetAsyncKeyState(pVirtualKeyCodesMapping[i]);
Ritor1
parents:
diff changeset
120 }
Ritor1
parents:
diff changeset
121
Ritor1
parents:
diff changeset
122 //----- (00459E5A) --------------------------------------------------------
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
123 void KeyboardActionMapping::EnterText(int a2, int max_string_len, GUIWindow *pWindow)
0
Ritor1
parents:
diff changeset
124 {
Ritor1
parents:
diff changeset
125 KeyboardActionMapping *v4; // esi@1
Ritor1
parents:
diff changeset
126
Ritor1
parents:
diff changeset
127 v4 = this;
Ritor1
parents:
diff changeset
128 memset(this->pPressedKeysBuffer, 0, 0x101u);
Ritor1
parents:
diff changeset
129 v4->uNumKeysPressed = 0;
Ritor1
parents:
diff changeset
130 if ( a2 )
Ritor1
parents:
diff changeset
131 v4->field_204 = 2;
Ritor1
parents:
diff changeset
132 else
Ritor1
parents:
diff changeset
133 v4->field_204 = 1;
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
134 v4->max_input_string_len = max_string_len;
0
Ritor1
parents:
diff changeset
135 v4->pWindow = pWindow;
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
136 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_IN_PROGRESS;
0
Ritor1
parents:
diff changeset
137 }
Ritor1
parents:
diff changeset
138
Ritor1
parents:
diff changeset
139 //----- (00459ED1) --------------------------------------------------------
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
140 void KeyboardActionMapping::SetWindowInputStatus(int a2)
0
Ritor1
parents:
diff changeset
141 {
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
142 field_204 = 0;
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
143 if ( pWindow )
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
144 pWindow->receives_keyboard_input_2 = a2;
0
Ritor1
parents:
diff changeset
145 }
Ritor1
parents:
diff changeset
146
Ritor1
parents:
diff changeset
147 //----- (00459F10) --------------------------------------------------------
Ritor1
parents:
diff changeset
148 bool KeyboardActionMapping::_459F10(unsigned int a2)
Ritor1
parents:
diff changeset
149 {
Ritor1
parents:
diff changeset
150 int v3; // [sp-4h] [bp-4h]@3
Ritor1
parents:
diff changeset
151
Ritor1
parents:
diff changeset
152 pKeyActionMap->uLastKeyPressed = a2;
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
153 if ( uGameMenuUI_CurentlySelectedKeyIdx == -1 )
0
Ritor1
parents:
diff changeset
154 {
Ritor1
parents:
diff changeset
155 if ( pKeyActionMap->field_204 == 1 )
Ritor1
parents:
diff changeset
156 {
Ritor1
parents:
diff changeset
157 if ( a2 != 8 )
Ritor1
parents:
diff changeset
158 {
Ritor1
parents:
diff changeset
159 if ( a2 == 9 )
Ritor1
parents:
diff changeset
160 return 1;
Ritor1
parents:
diff changeset
161 if ( a2 == 13 )
Ritor1
parents:
diff changeset
162 goto LABEL_3;
Ritor1
parents:
diff changeset
163 if ( a2 == 27 )
Ritor1
parents:
diff changeset
164 goto LABEL_15;
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
165 if ( this->uNumKeysPressed >= this->max_input_string_len )
0
Ritor1
parents:
diff changeset
166 return 1;
Ritor1
parents:
diff changeset
167 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
Ritor1
parents:
diff changeset
168 ++pKeyActionMap->uNumKeysPressed;
Ritor1
parents:
diff changeset
169 LABEL_24:
Ritor1
parents:
diff changeset
170 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
Ritor1
parents:
diff changeset
171 return 1;
Ritor1
parents:
diff changeset
172 }
Ritor1
parents:
diff changeset
173 }
Ritor1
parents:
diff changeset
174 else
Ritor1
parents:
diff changeset
175 {
Ritor1
parents:
diff changeset
176 if ( pKeyActionMap->field_204 != 2 )
Ritor1
parents:
diff changeset
177 return 0;
Ritor1
parents:
diff changeset
178 if ( a2 != 8 )
Ritor1
parents:
diff changeset
179 {
Ritor1
parents:
diff changeset
180 if ( a2 == 13 )
Ritor1
parents:
diff changeset
181 goto LABEL_3;
Ritor1
parents:
diff changeset
182 if ( a2 != 27 )
Ritor1
parents:
diff changeset
183 {
Ritor1
parents:
diff changeset
184 if ( (signed int)a2 >= 48 && (signed int)a2 <= 57 )
Ritor1
parents:
diff changeset
185 {
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
186 if ( pKeyActionMap->uNumKeysPressed < this->max_input_string_len )
0
Ritor1
parents:
diff changeset
187 {
Ritor1
parents:
diff changeset
188 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
Ritor1
parents:
diff changeset
189 ++pKeyActionMap->uNumKeysPressed;
Ritor1
parents:
diff changeset
190 }
Ritor1
parents:
diff changeset
191 }
Ritor1
parents:
diff changeset
192 return 1;
Ritor1
parents:
diff changeset
193 }
Ritor1
parents:
diff changeset
194 LABEL_15:
1459
2ca62c9e7b3c Function names
Nomad
parents: 1297
diff changeset
195 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
2ca62c9e7b3c Function names
Nomad
parents: 1297
diff changeset
196 return 1;
0
Ritor1
parents:
diff changeset
197 }
Ritor1
parents:
diff changeset
198 }
Ritor1
parents:
diff changeset
199 if ( !pKeyActionMap->uNumKeysPressed )
Ritor1
parents:
diff changeset
200 return 1;
Ritor1
parents:
diff changeset
201 --pKeyActionMap->uNumKeysPressed;
Ritor1
parents:
diff changeset
202 goto LABEL_24;
Ritor1
parents:
diff changeset
203 }
Ritor1
parents:
diff changeset
204 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
Ritor1
parents:
diff changeset
205 ++pKeyActionMap->uNumKeysPressed;
Ritor1
parents:
diff changeset
206 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
1459
2ca62c9e7b3c Function names
Nomad
parents: 1297
diff changeset
207
0
Ritor1
parents:
diff changeset
208 LABEL_3:
1459
2ca62c9e7b3c Function names
Nomad
parents: 1297
diff changeset
209 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
0
Ritor1
parents:
diff changeset
210 return 1;
Ritor1
parents:
diff changeset
211 }
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
212 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
0
Ritor1
parents:
diff changeset
213
Ritor1
parents:
diff changeset
214 //----- (00459FFC) --------------------------------------------------------
Ritor1
parents:
diff changeset
215 void KeyboardActionMapping::ReadMappings()
Ritor1
parents:
diff changeset
216 {
Ritor1
parents:
diff changeset
217 //KeyboardActionMapping *v1; // esi@1
Ritor1
parents:
diff changeset
218 int v2; // eax@2
Ritor1
parents:
diff changeset
219 unsigned int v3; // eax@3
Ritor1
parents:
diff changeset
220 int v4; // eax@6
Ritor1
parents:
diff changeset
221 unsigned int v5; // eax@7
Ritor1
parents:
diff changeset
222 int v6; // eax@10
Ritor1
parents:
diff changeset
223 unsigned int v7; // eax@11
Ritor1
parents:
diff changeset
224 int v8; // eax@14
Ritor1
parents:
diff changeset
225 unsigned int v9; // eax@15
Ritor1
parents:
diff changeset
226 int v10; // eax@18
Ritor1
parents:
diff changeset
227 unsigned int v11; // eax@19
Ritor1
parents:
diff changeset
228 int v12; // eax@22
Ritor1
parents:
diff changeset
229 //unsigned int v13; // eax@23
Ritor1
parents:
diff changeset
230 int v14; // eax@26
Ritor1
parents:
diff changeset
231 //unsigned int v15; // eax@27
Ritor1
parents:
diff changeset
232 int v16; // eax@30
Ritor1
parents:
diff changeset
233 //unsigned int v17; // eax@31
Ritor1
parents:
diff changeset
234 int v18; // eax@34
Ritor1
parents:
diff changeset
235 //unsigned int v19; // eax@35
Ritor1
parents:
diff changeset
236 int v20; // eax@38
Ritor1
parents:
diff changeset
237 //unsigned int v21; // eax@39
Ritor1
parents:
diff changeset
238 int v22; // eax@42
Ritor1
parents:
diff changeset
239 //unsigned int v23; // eax@43
Ritor1
parents:
diff changeset
240 int v24; // eax@46
Ritor1
parents:
diff changeset
241 //unsigned int v25; // eax@47
Ritor1
parents:
diff changeset
242 int v26; // eax@50
Ritor1
parents:
diff changeset
243 //unsigned int v27; // eax@51
Ritor1
parents:
diff changeset
244 int v28; // eax@54
Ritor1
parents:
diff changeset
245 //unsigned int v29; // eax@55
Ritor1
parents:
diff changeset
246 int v30; // eax@58
Ritor1
parents:
diff changeset
247 //unsigned int v31; // eax@59
Ritor1
parents:
diff changeset
248 int v32; // eax@62
Ritor1
parents:
diff changeset
249 //unsigned int v33; // eax@63
Ritor1
parents:
diff changeset
250 int v34; // eax@66
Ritor1
parents:
diff changeset
251 //unsigned int v35; // eax@67
Ritor1
parents:
diff changeset
252 int v36; // eax@70
Ritor1
parents:
diff changeset
253 //unsigned int v37; // eax@71
Ritor1
parents:
diff changeset
254 int v38; // eax@74
Ritor1
parents:
diff changeset
255 //unsigned int v39; // eax@75
Ritor1
parents:
diff changeset
256 int v40; // eax@78
Ritor1
parents:
diff changeset
257 //unsigned int v41; // eax@79
Ritor1
parents:
diff changeset
258 int v42; // eax@82
Ritor1
parents:
diff changeset
259 //unsigned int v43; // eax@83
Ritor1
parents:
diff changeset
260 int v44; // eax@86
Ritor1
parents:
diff changeset
261 //unsigned int v45; // eax@87
Ritor1
parents:
diff changeset
262 int v46; // eax@90
Ritor1
parents:
diff changeset
263 //unsigned int v47; // eax@91
Ritor1
parents:
diff changeset
264 int v48; // eax@94
Ritor1
parents:
diff changeset
265 //unsigned int v49; // eax@95
Ritor1
parents:
diff changeset
266 int v50; // eax@98
Ritor1
parents:
diff changeset
267 //unsigned int v51; // eax@99
Ritor1
parents:
diff changeset
268 int v52; // eax@102
Ritor1
parents:
diff changeset
269 //unsigned int v53; // eax@103
Ritor1
parents:
diff changeset
270 int v54; // eax@106
Ritor1
parents:
diff changeset
271 //unsigned int v55; // eax@107
Ritor1
parents:
diff changeset
272 int v56; // eax@110
Ritor1
parents:
diff changeset
273 unsigned int v57; // eax@111
Ritor1
parents:
diff changeset
274 int v58; // eax@114
Ritor1
parents:
diff changeset
275 unsigned int v59; // eax@115
Ritor1
parents:
diff changeset
276 int v60; // eax@118
Ritor1
parents:
diff changeset
277 unsigned int v61; // eax@119
Ritor1
parents:
diff changeset
278 //char str[32]; // [sp+Ch] [bp-20h]@1
Ritor1
parents:
diff changeset
279
Ritor1
parents:
diff changeset
280 char str[32];
Ritor1
parents:
diff changeset
281
Ritor1
parents:
diff changeset
282 ReadWindowsRegistryString("KEY_FORWARD", str, 32, "DEFAULT");
Ritor1
parents:
diff changeset
283 if ( strcmp(str, "DEFAULT") && (LOBYTE(v2) = GetActionDefaultVKey(str), v2 != -1) )
Ritor1
parents:
diff changeset
284 {
Ritor1
parents:
diff changeset
285 pVirtualKeyCodesMapping[0] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
286 }
Ritor1
parents:
diff changeset
287 else
Ritor1
parents:
diff changeset
288 {
Ritor1
parents:
diff changeset
289 pVirtualKeyCodesMapping[0] = VK_UP;
Ritor1
parents:
diff changeset
290 }
Ritor1
parents:
diff changeset
291 pToggleTypes[0] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
292 ReadWindowsRegistryString("KEY_BACKWARD", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
293 if ( strcmp(str, "DEFAULT") && (LOBYTE(v4) = GetActionDefaultVKey(str), v4 != -1) )
Ritor1
parents:
diff changeset
294 {
Ritor1
parents:
diff changeset
295 pVirtualKeyCodesMapping[1] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
296 }
Ritor1
parents:
diff changeset
297 else
Ritor1
parents:
diff changeset
298 {
Ritor1
parents:
diff changeset
299 pVirtualKeyCodesMapping[1] = VK_DOWN;
Ritor1
parents:
diff changeset
300 }
Ritor1
parents:
diff changeset
301 pToggleTypes[1] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
302
Ritor1
parents:
diff changeset
303 ReadWindowsRegistryString("KEY_LEFT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
304 if ( strcmp(str, "DEFAULT") && (LOBYTE(v6) = GetActionDefaultVKey(str), v6 != -1) )
Ritor1
parents:
diff changeset
305 {
Ritor1
parents:
diff changeset
306 pVirtualKeyCodesMapping[2] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
307 }
Ritor1
parents:
diff changeset
308 else
Ritor1
parents:
diff changeset
309 {
Ritor1
parents:
diff changeset
310 pVirtualKeyCodesMapping[2] = VK_LEFT;
Ritor1
parents:
diff changeset
311 }
Ritor1
parents:
diff changeset
312 pToggleTypes[2] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
313
Ritor1
parents:
diff changeset
314 ReadWindowsRegistryString("KEY_RIGHT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
315 if ( strcmp(str, "DEFAULT") && (LOBYTE(v8) = GetActionDefaultVKey(str), v8 != -1) )
Ritor1
parents:
diff changeset
316 {
Ritor1
parents:
diff changeset
317 pVirtualKeyCodesMapping[3] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
318 }
Ritor1
parents:
diff changeset
319 else
Ritor1
parents:
diff changeset
320 {
Ritor1
parents:
diff changeset
321 pVirtualKeyCodesMapping[3] = VK_RIGHT;
Ritor1
parents:
diff changeset
322 }
Ritor1
parents:
diff changeset
323 pToggleTypes[3] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
324
Ritor1
parents:
diff changeset
325 ReadWindowsRegistryString("KEY_ATTACK", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
326 if ( strcmp(str, "DEFAULT") && (LOBYTE(v10) = GetActionDefaultVKey(str), v10 != -1) )
Ritor1
parents:
diff changeset
327 {
Ritor1
parents:
diff changeset
328 pVirtualKeyCodesMapping[8] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
329 }
Ritor1
parents:
diff changeset
330 else
Ritor1
parents:
diff changeset
331 {
Ritor1
parents:
diff changeset
332 pVirtualKeyCodesMapping[8] = 'A';
Ritor1
parents:
diff changeset
333 }
Ritor1
parents:
diff changeset
334 pToggleTypes[8] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
335
Ritor1
parents:
diff changeset
336 ReadWindowsRegistryString("KEY_CASTREADY", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
337 if ( strcmp(str, "DEFAULT") && (LOBYTE(v12) = GetActionDefaultVKey(str), v12 != -1) )
Ritor1
parents:
diff changeset
338 {
Ritor1
parents:
diff changeset
339 pVirtualKeyCodesMapping[7] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
340 }
Ritor1
parents:
diff changeset
341 else
Ritor1
parents:
diff changeset
342 {
Ritor1
parents:
diff changeset
343 pVirtualKeyCodesMapping[7] = 'S';
Ritor1
parents:
diff changeset
344 }
Ritor1
parents:
diff changeset
345 pToggleTypes[7] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
346
Ritor1
parents:
diff changeset
347 ReadWindowsRegistryString("KEY_YELL", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
348 if ( strcmp(str, "DEFAULT") && (LOBYTE(v14) = GetActionDefaultVKey(str), v14 != -1) )
Ritor1
parents:
diff changeset
349 {
Ritor1
parents:
diff changeset
350 pVirtualKeyCodesMapping[4] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
351 }
Ritor1
parents:
diff changeset
352 else
Ritor1
parents:
diff changeset
353 {
Ritor1
parents:
diff changeset
354 pVirtualKeyCodesMapping[4] = 'Y';
Ritor1
parents:
diff changeset
355 }
Ritor1
parents:
diff changeset
356 pToggleTypes[4] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
357
Ritor1
parents:
diff changeset
358 ReadWindowsRegistryString("KEY_JUMP", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
359 if ( strcmp(str, "DEFAULT") && (LOBYTE(v16) = GetActionDefaultVKey(str), v16 != -1) )
Ritor1
parents:
diff changeset
360 {
Ritor1
parents:
diff changeset
361 pVirtualKeyCodesMapping[5] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
362 }
Ritor1
parents:
diff changeset
363 else
Ritor1
parents:
diff changeset
364 {
Ritor1
parents:
diff changeset
365 pVirtualKeyCodesMapping[5] = 'X';
Ritor1
parents:
diff changeset
366 }
Ritor1
parents:
diff changeset
367 pToggleTypes[5] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
368
Ritor1
parents:
diff changeset
369 ReadWindowsRegistryString("KEY_COMBAT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
370 if ( strcmp(str, "DEFAULT") && (LOBYTE(v18) = GetActionDefaultVKey(str), v18 != -1) )
Ritor1
parents:
diff changeset
371 {
Ritor1
parents:
diff changeset
372 pVirtualKeyCodesMapping[6] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
373 }
Ritor1
parents:
diff changeset
374 else
Ritor1
parents:
diff changeset
375 {
Ritor1
parents:
diff changeset
376 pVirtualKeyCodesMapping[6] = VK_RETURN;
Ritor1
parents:
diff changeset
377 }
Ritor1
parents:
diff changeset
378 pToggleTypes[6] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
379
Ritor1
parents:
diff changeset
380 ReadWindowsRegistryString("KEY_EVENTTRIGGER", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
381 if ( strcmp(str, "DEFAULT") && (LOBYTE(v20) = GetActionDefaultVKey(str), v20 != -1) )
Ritor1
parents:
diff changeset
382 {
Ritor1
parents:
diff changeset
383 pVirtualKeyCodesMapping[9] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
384 }
Ritor1
parents:
diff changeset
385 else
Ritor1
parents:
diff changeset
386 {
Ritor1
parents:
diff changeset
387 pVirtualKeyCodesMapping[9] = VK_SPACE;
Ritor1
parents:
diff changeset
388 }
Ritor1
parents:
diff changeset
389 pToggleTypes[9] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
390
Ritor1
parents:
diff changeset
391 ReadWindowsRegistryString("KEY_CAST", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
392 if ( strcmp(str, "DEFAULT") && (LOBYTE(v22) = GetActionDefaultVKey(str), v22 != -1) )
Ritor1
parents:
diff changeset
393 {
Ritor1
parents:
diff changeset
394 pVirtualKeyCodesMapping[10] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
395 }
Ritor1
parents:
diff changeset
396 else
Ritor1
parents:
diff changeset
397 {
Ritor1
parents:
diff changeset
398 pVirtualKeyCodesMapping[10] = 'C';
Ritor1
parents:
diff changeset
399 }
Ritor1
parents:
diff changeset
400 pToggleTypes[10] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
401
Ritor1
parents:
diff changeset
402 ReadWindowsRegistryString("KEY_PASS", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
403 if ( strcmp(str, "DEFAULT") && (LOBYTE(v24) = GetActionDefaultVKey(str), v24 != -1) )
Ritor1
parents:
diff changeset
404 {
Ritor1
parents:
diff changeset
405 pVirtualKeyCodesMapping[11] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
406 }
Ritor1
parents:
diff changeset
407 else
Ritor1
parents:
diff changeset
408 {
Ritor1
parents:
diff changeset
409 pVirtualKeyCodesMapping[11] = 'B';
Ritor1
parents:
diff changeset
410 }
Ritor1
parents:
diff changeset
411 pToggleTypes[11] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
412
Ritor1
parents:
diff changeset
413 ReadWindowsRegistryString("KEY_CHARCYCLE", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
414 if ( strcmp(str, "DEFAULT") && (LOBYTE(v26) = GetActionDefaultVKey(str), v26 != -1) )
Ritor1
parents:
diff changeset
415 {
Ritor1
parents:
diff changeset
416 pVirtualKeyCodesMapping[12] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
417 }
Ritor1
parents:
diff changeset
418 else
Ritor1
parents:
diff changeset
419 {
Ritor1
parents:
diff changeset
420 pVirtualKeyCodesMapping[12] = VK_TAB;
Ritor1
parents:
diff changeset
421 }
Ritor1
parents:
diff changeset
422 pToggleTypes[12] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
423
Ritor1
parents:
diff changeset
424 ReadWindowsRegistryString("KEY_QUEST", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
425 if ( strcmp(str, "DEFAULT") && (LOBYTE(v28) = GetActionDefaultVKey(str), v28 != -1) )
Ritor1
parents:
diff changeset
426 {
Ritor1
parents:
diff changeset
427 pVirtualKeyCodesMapping[13] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
428 }
Ritor1
parents:
diff changeset
429 else
Ritor1
parents:
diff changeset
430 {
Ritor1
parents:
diff changeset
431 pVirtualKeyCodesMapping[13] = 'Q';
Ritor1
parents:
diff changeset
432 }
Ritor1
parents:
diff changeset
433 pToggleTypes[13] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
434
Ritor1
parents:
diff changeset
435 ReadWindowsRegistryString("KEY_QUICKREF", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
436 if ( strcmp(str, "DEFAULT") && (LOBYTE(v30) = GetActionDefaultVKey(str), v30 != -1) )
Ritor1
parents:
diff changeset
437 {
Ritor1
parents:
diff changeset
438 pVirtualKeyCodesMapping[14] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
439 }
Ritor1
parents:
diff changeset
440 else
Ritor1
parents:
diff changeset
441 {
Ritor1
parents:
diff changeset
442 pVirtualKeyCodesMapping[14] = 'Z';
Ritor1
parents:
diff changeset
443 }
Ritor1
parents:
diff changeset
444 pToggleTypes[14] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
445
Ritor1
parents:
diff changeset
446 ReadWindowsRegistryString("KEY_REST", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
447 if ( strcmp(str, "DEFAULT") && (LOBYTE(v32) = GetActionDefaultVKey(str), v32 != -1) )
Ritor1
parents:
diff changeset
448 {
Ritor1
parents:
diff changeset
449 pVirtualKeyCodesMapping[15] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
450 }
Ritor1
parents:
diff changeset
451 else
Ritor1
parents:
diff changeset
452 {
Ritor1
parents:
diff changeset
453 pVirtualKeyCodesMapping[15] = 'R';
Ritor1
parents:
diff changeset
454 }
Ritor1
parents:
diff changeset
455 pToggleTypes[15] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
456
Ritor1
parents:
diff changeset
457 ReadWindowsRegistryString("KEY_TIMECAL", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
458 if ( strcmp(str, "DEFAULT") && (LOBYTE(v34) = GetActionDefaultVKey(str), v34 != -1) )
Ritor1
parents:
diff changeset
459 {
Ritor1
parents:
diff changeset
460 pVirtualKeyCodesMapping[16] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
461 }
Ritor1
parents:
diff changeset
462 else
Ritor1
parents:
diff changeset
463 {
Ritor1
parents:
diff changeset
464 pVirtualKeyCodesMapping[16] = 'T';
Ritor1
parents:
diff changeset
465 }
Ritor1
parents:
diff changeset
466 pToggleTypes[16] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
467
Ritor1
parents:
diff changeset
468 ReadWindowsRegistryString("KEY_AUTONOTES", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
469 if ( strcmp(str, "DEFAULT") && (LOBYTE(v36) = GetActionDefaultVKey(str), v36 != -1) )
Ritor1
parents:
diff changeset
470 {
Ritor1
parents:
diff changeset
471 pVirtualKeyCodesMapping[17] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
472 }
Ritor1
parents:
diff changeset
473 else
Ritor1
parents:
diff changeset
474 {
Ritor1
parents:
diff changeset
475 pVirtualKeyCodesMapping[17] = 'N';
Ritor1
parents:
diff changeset
476 }
Ritor1
parents:
diff changeset
477 pToggleTypes[17] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
478
Ritor1
parents:
diff changeset
479 ReadWindowsRegistryString("KEY_MAPBOOK", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
480 if ( strcmp(str, "DEFAULT") && (LOBYTE(v38) = GetActionDefaultVKey(str), v38 != -1) )
Ritor1
parents:
diff changeset
481 {
Ritor1
parents:
diff changeset
482 pVirtualKeyCodesMapping[18] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
483 }
Ritor1
parents:
diff changeset
484 else
Ritor1
parents:
diff changeset
485 {
Ritor1
parents:
diff changeset
486 pVirtualKeyCodesMapping[18] = 'M';
Ritor1
parents:
diff changeset
487 }
Ritor1
parents:
diff changeset
488 pToggleTypes[18] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
489
Ritor1
parents:
diff changeset
490 ReadWindowsRegistryString("KEY_LOOKUP", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
491 if ( strcmp(str, "DEFAULT") && (LOBYTE(v40) = GetActionDefaultVKey(str), v40 != -1) )
Ritor1
parents:
diff changeset
492 {
Ritor1
parents:
diff changeset
493 pVirtualKeyCodesMapping[20] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
494 }
Ritor1
parents:
diff changeset
495 else
Ritor1
parents:
diff changeset
496 {
Ritor1
parents:
diff changeset
497 pVirtualKeyCodesMapping[20] = VK_NEXT;
Ritor1
parents:
diff changeset
498 }
Ritor1
parents:
diff changeset
499 pToggleTypes[20] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
500
Ritor1
parents:
diff changeset
501 ReadWindowsRegistryString("KEY_LOOKDOWN", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
502 if ( strcmp(str, "DEFAULT") && (LOBYTE(v42) = GetActionDefaultVKey(str), v42 != -1) )
Ritor1
parents:
diff changeset
503 {
Ritor1
parents:
diff changeset
504 pVirtualKeyCodesMapping[21] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
505 }
Ritor1
parents:
diff changeset
506 else
Ritor1
parents:
diff changeset
507 {
Ritor1
parents:
diff changeset
508 pVirtualKeyCodesMapping[21] = VK_DELETE;
Ritor1
parents:
diff changeset
509 }
Ritor1
parents:
diff changeset
510 pToggleTypes[21] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
511
Ritor1
parents:
diff changeset
512 ReadWindowsRegistryString("KEY_CENTERVIEWPT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
513 if ( strcmp(str, "DEFAULT") && (LOBYTE(v44) = GetActionDefaultVKey(str), v44 != -1) )
Ritor1
parents:
diff changeset
514 {
Ritor1
parents:
diff changeset
515 pVirtualKeyCodesMapping[22] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
516 }
Ritor1
parents:
diff changeset
517 else
Ritor1
parents:
diff changeset
518 {
Ritor1
parents:
diff changeset
519 pVirtualKeyCodesMapping[22] = VK_END;
Ritor1
parents:
diff changeset
520 }
Ritor1
parents:
diff changeset
521 pToggleTypes[22] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
522
Ritor1
parents:
diff changeset
523 ReadWindowsRegistryString("KEY_ZOOMIN", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
524 if ( strcmp(str, "DEFAULT") && (LOBYTE(v46) = GetActionDefaultVKey(str), v46 != -1) )
Ritor1
parents:
diff changeset
525 {
Ritor1
parents:
diff changeset
526 pVirtualKeyCodesMapping[23] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
527 }
Ritor1
parents:
diff changeset
528 else
Ritor1
parents:
diff changeset
529 {
Ritor1
parents:
diff changeset
530 pVirtualKeyCodesMapping[23] = VK_ADD;
Ritor1
parents:
diff changeset
531 }
Ritor1
parents:
diff changeset
532 pToggleTypes[23] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
533
Ritor1
parents:
diff changeset
534 ReadWindowsRegistryString("KEY_ZOOMOUT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
535 if ( strcmp(str, "DEFAULT") && (LOBYTE(v48) = GetActionDefaultVKey(str), v48 != -1) )
Ritor1
parents:
diff changeset
536 {
Ritor1
parents:
diff changeset
537 pVirtualKeyCodesMapping[24] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
538 }
Ritor1
parents:
diff changeset
539 else
Ritor1
parents:
diff changeset
540 {
Ritor1
parents:
diff changeset
541 pVirtualKeyCodesMapping[24] = VK_SUBTRACT;
Ritor1
parents:
diff changeset
542 }
Ritor1
parents:
diff changeset
543 pToggleTypes[24] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
544
Ritor1
parents:
diff changeset
545 ReadWindowsRegistryString("KEY_FLYUP", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
546 if ( strcmp(str, "DEFAULT") && (LOBYTE(v50) = GetActionDefaultVKey(str), v50 != -1) )
Ritor1
parents:
diff changeset
547 {
Ritor1
parents:
diff changeset
548 pVirtualKeyCodesMapping[25] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
549 }
Ritor1
parents:
diff changeset
550 else
Ritor1
parents:
diff changeset
551 {
Ritor1
parents:
diff changeset
552 pVirtualKeyCodesMapping[25] = VK_PRIOR;
Ritor1
parents:
diff changeset
553 }
Ritor1
parents:
diff changeset
554 pToggleTypes[25] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
555
Ritor1
parents:
diff changeset
556 ReadWindowsRegistryString("KEY_FLYDOWN", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
557 if ( strcmp(str, "DEFAULT") && (LOBYTE(v52) = GetActionDefaultVKey(str), v52 != -1) )
Ritor1
parents:
diff changeset
558 {
Ritor1
parents:
diff changeset
559 pVirtualKeyCodesMapping[26] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
560 }
Ritor1
parents:
diff changeset
561 else
Ritor1
parents:
diff changeset
562 {
Ritor1
parents:
diff changeset
563 pVirtualKeyCodesMapping[26] = VK_INSERT;
Ritor1
parents:
diff changeset
564 }
Ritor1
parents:
diff changeset
565 pToggleTypes[26] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
566
Ritor1
parents:
diff changeset
567 ReadWindowsRegistryString("KEY_LAND", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
568 if ( strcmp(str, "DEFAULT") && (LOBYTE(v54) = GetActionDefaultVKey(str), v54 != -1) )
Ritor1
parents:
diff changeset
569 {
Ritor1
parents:
diff changeset
570 pVirtualKeyCodesMapping[27] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
571 }
Ritor1
parents:
diff changeset
572 else
Ritor1
parents:
diff changeset
573 {
Ritor1
parents:
diff changeset
574 pVirtualKeyCodesMapping[27] = VK_HOME;
Ritor1
parents:
diff changeset
575 }
Ritor1
parents:
diff changeset
576 pToggleTypes[27] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
577
Ritor1
parents:
diff changeset
578 ReadWindowsRegistryString("KEY_ALWAYSRUN", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
579 if ( strcmp(str, "DEFAULT") && (LOBYTE(v56) = GetActionDefaultVKey(str), v56 != -1) )
Ritor1
parents:
diff changeset
580 {
Ritor1
parents:
diff changeset
581 pVirtualKeyCodesMapping[19] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
582 }
Ritor1
parents:
diff changeset
583 else
Ritor1
parents:
diff changeset
584 {
Ritor1
parents:
diff changeset
585 pVirtualKeyCodesMapping[19] = 'U';
Ritor1
parents:
diff changeset
586 }
Ritor1
parents:
diff changeset
587 pToggleTypes[19] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
588
Ritor1
parents:
diff changeset
589 bAlwaysRun = ReadWindowsRegistryInt("valAlwaysRun", 0) != 0;
Ritor1
parents:
diff changeset
590 bFlipOnExit = ReadWindowsRegistryInt("FlipOnExit", 0) != 0;
Ritor1
parents:
diff changeset
591 ReadWindowsRegistryString("KEY_STEPLEFT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
592 if ( strcmp(str, "DEFAULT") && (LOBYTE(v58) = GetActionDefaultVKey(str), v58 != -1) )
Ritor1
parents:
diff changeset
593 {
Ritor1
parents:
diff changeset
594 pVirtualKeyCodesMapping[28] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
595 pToggleTypes[28] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
596 }
Ritor1
parents:
diff changeset
597 else
Ritor1
parents:
diff changeset
598 {
Ritor1
parents:
diff changeset
599 pToggleTypes[28] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
600 pVirtualKeyCodesMapping[28] = VK_OEM_4;
Ritor1
parents:
diff changeset
601 }
Ritor1
parents:
diff changeset
602
Ritor1
parents:
diff changeset
603 ReadWindowsRegistryString("KEY_STEPRIGHT", str, 0x20u, "DEFAULT");
Ritor1
parents:
diff changeset
604 if ( strcmp(str, "DEFAULT") && (LOBYTE(v60) = GetActionDefaultVKey(str), v60 != -1) )
Ritor1
parents:
diff changeset
605 {
Ritor1
parents:
diff changeset
606 pVirtualKeyCodesMapping[29] = GetActionDefaultVKey(str);
Ritor1
parents:
diff changeset
607 pToggleTypes[29] = TOGGLE_OneTimePress;
Ritor1
parents:
diff changeset
608 }
Ritor1
parents:
diff changeset
609 else
Ritor1
parents:
diff changeset
610 {
Ritor1
parents:
diff changeset
611 pToggleTypes[29] = TOGGLE_Continuously;
Ritor1
parents:
diff changeset
612 pVirtualKeyCodesMapping[29] = VK_OEM_6;
Ritor1
parents:
diff changeset
613 }
Ritor1
parents:
diff changeset
614 }
Ritor1
parents:
diff changeset
615
Ritor1
parents:
diff changeset
616 //----- (0045A960) --------------------------------------------------------
Ritor1
parents:
diff changeset
617 void KeyboardActionMapping::StoreMappings()
Ritor1
parents:
diff changeset
618 {
Ritor1
parents:
diff changeset
619 const char *v2; // eax@1
Ritor1
parents:
diff changeset
620 const char *v3; // eax@1
Ritor1
parents:
diff changeset
621 const char *v4; // eax@1
Ritor1
parents:
diff changeset
622 const char *v5; // eax@1
Ritor1
parents:
diff changeset
623 const char *v6; // eax@1
Ritor1
parents:
diff changeset
624 const char *v7; // eax@1
Ritor1
parents:
diff changeset
625 const char *v8; // eax@1
Ritor1
parents:
diff changeset
626 const char *v9; // eax@1
Ritor1
parents:
diff changeset
627 const char *v10; // eax@1
Ritor1
parents:
diff changeset
628 const char *v11; // eax@1
Ritor1
parents:
diff changeset
629 const char *v12; // eax@1
Ritor1
parents:
diff changeset
630 const char *v13; // eax@1
Ritor1
parents:
diff changeset
631 const char *v14; // eax@1
Ritor1
parents:
diff changeset
632 const char *v15; // eax@1
Ritor1
parents:
diff changeset
633 const char *v16; // eax@1
Ritor1
parents:
diff changeset
634 const char *v17; // eax@1
Ritor1
parents:
diff changeset
635 const char *v18; // eax@1
Ritor1
parents:
diff changeset
636 const char *v19; // eax@1
Ritor1
parents:
diff changeset
637 const char *v20; // eax@1
Ritor1
parents:
diff changeset
638 const char *v21; // eax@1
Ritor1
parents:
diff changeset
639 const char *v22; // eax@1
Ritor1
parents:
diff changeset
640 const char *v23; // eax@1
Ritor1
parents:
diff changeset
641 const char *v24; // eax@1
Ritor1
parents:
diff changeset
642 const char *v25; // eax@1
Ritor1
parents:
diff changeset
643 const char *v26; // eax@1
Ritor1
parents:
diff changeset
644 const char *v27; // eax@1
Ritor1
parents:
diff changeset
645 const char *v28; // eax@1
Ritor1
parents:
diff changeset
646 const char *v29; // eax@1
Ritor1
parents:
diff changeset
647
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
648 v2 = GetVKeyDisplayName(pVirtualKeyCodesMapping[0]);
0
Ritor1
parents:
diff changeset
649 WriteWindowsRegistryString("KEY_FORWARD", v2);
Ritor1
parents:
diff changeset
650 v3 = GetVKeyDisplayName(pVirtualKeyCodesMapping[1]);
Ritor1
parents:
diff changeset
651 WriteWindowsRegistryString("KEY_BACKWARD", v3);
Ritor1
parents:
diff changeset
652 v4 = GetVKeyDisplayName(pVirtualKeyCodesMapping[2]);
Ritor1
parents:
diff changeset
653 WriteWindowsRegistryString("KEY_LEFT", v4);
Ritor1
parents:
diff changeset
654 v5 = GetVKeyDisplayName(pVirtualKeyCodesMapping[3]);
Ritor1
parents:
diff changeset
655 WriteWindowsRegistryString("KEY_RIGHT", v5);
Ritor1
parents:
diff changeset
656 v6 = GetVKeyDisplayName(pVirtualKeyCodesMapping[8]);
Ritor1
parents:
diff changeset
657 WriteWindowsRegistryString("KEY_ATTACK", v6);
Ritor1
parents:
diff changeset
658 v7 = GetVKeyDisplayName(pVirtualKeyCodesMapping[7]);
Ritor1
parents:
diff changeset
659 WriteWindowsRegistryString("KEY_CASTREADY", v7);
Ritor1
parents:
diff changeset
660 v8 = GetVKeyDisplayName(pVirtualKeyCodesMapping[4]);
Ritor1
parents:
diff changeset
661 WriteWindowsRegistryString("KEY_YELL", v8);
Ritor1
parents:
diff changeset
662 v9 = GetVKeyDisplayName(pVirtualKeyCodesMapping[5]);
Ritor1
parents:
diff changeset
663 WriteWindowsRegistryString("KEY_JUMP", v9);
Ritor1
parents:
diff changeset
664 v10 = GetVKeyDisplayName(pVirtualKeyCodesMapping[6]);
Ritor1
parents:
diff changeset
665 WriteWindowsRegistryString("KEY_COMBAT", v10);
Ritor1
parents:
diff changeset
666 v11 = GetVKeyDisplayName(pVirtualKeyCodesMapping[9]);
Ritor1
parents:
diff changeset
667 WriteWindowsRegistryString("KEY_EVENTTRIGGER", v11);
Ritor1
parents:
diff changeset
668 v12 = GetVKeyDisplayName(pVirtualKeyCodesMapping[10]);
Ritor1
parents:
diff changeset
669 WriteWindowsRegistryString("KEY_CAST", v12);
Ritor1
parents:
diff changeset
670 v13 = GetVKeyDisplayName(pVirtualKeyCodesMapping[11]);
Ritor1
parents:
diff changeset
671 WriteWindowsRegistryString("KEY_PASS", v13);
Ritor1
parents:
diff changeset
672 v14 = GetVKeyDisplayName(pVirtualKeyCodesMapping[12]);
Ritor1
parents:
diff changeset
673 WriteWindowsRegistryString("KEY_CHARCYCLE", v14);
Ritor1
parents:
diff changeset
674 v15 = GetVKeyDisplayName(pVirtualKeyCodesMapping[13]);
Ritor1
parents:
diff changeset
675 WriteWindowsRegistryString("KEY_QUEST", v15);
Ritor1
parents:
diff changeset
676 v16 = GetVKeyDisplayName(pVirtualKeyCodesMapping[14]);
Ritor1
parents:
diff changeset
677 WriteWindowsRegistryString("KEY_QUICKREF", v16);
Ritor1
parents:
diff changeset
678 v17 = GetVKeyDisplayName(pVirtualKeyCodesMapping[15]);
Ritor1
parents:
diff changeset
679 WriteWindowsRegistryString("KEY_REST", v17);
Ritor1
parents:
diff changeset
680 v18 = GetVKeyDisplayName(pVirtualKeyCodesMapping[16]);
Ritor1
parents:
diff changeset
681 WriteWindowsRegistryString("KEY_TIMECAL", v18);
Ritor1
parents:
diff changeset
682 v19 = GetVKeyDisplayName(pVirtualKeyCodesMapping[17]);
Ritor1
parents:
diff changeset
683 WriteWindowsRegistryString("KEY_AUTONOTES", v19);
Ritor1
parents:
diff changeset
684 v20 = GetVKeyDisplayName(pVirtualKeyCodesMapping[18]);
Ritor1
parents:
diff changeset
685 WriteWindowsRegistryString("KEY_MAPBOOK", v20);
Ritor1
parents:
diff changeset
686 v21 = GetVKeyDisplayName(pVirtualKeyCodesMapping[20]);
Ritor1
parents:
diff changeset
687 WriteWindowsRegistryString("KEY_LOOKUP", v21);
Ritor1
parents:
diff changeset
688 v22 = GetVKeyDisplayName(pVirtualKeyCodesMapping[21]);
Ritor1
parents:
diff changeset
689 WriteWindowsRegistryString("KEY_LOOKDOWN", v22);
Ritor1
parents:
diff changeset
690 v23 = GetVKeyDisplayName(pVirtualKeyCodesMapping[22]);
Ritor1
parents:
diff changeset
691 WriteWindowsRegistryString("KEY_CENTERVIEWPT", v23);
Ritor1
parents:
diff changeset
692 v24 = GetVKeyDisplayName(pVirtualKeyCodesMapping[23]);
Ritor1
parents:
diff changeset
693 WriteWindowsRegistryString("KEY_ZOOMIN", v24);
Ritor1
parents:
diff changeset
694 v25 = GetVKeyDisplayName(pVirtualKeyCodesMapping[24]);
Ritor1
parents:
diff changeset
695 WriteWindowsRegistryString("KEY_ZOOMOUT", v25);
Ritor1
parents:
diff changeset
696 v26 = GetVKeyDisplayName(pVirtualKeyCodesMapping[25]);
Ritor1
parents:
diff changeset
697 WriteWindowsRegistryString("KEY_FLYUP", v26);
Ritor1
parents:
diff changeset
698 v27 = GetVKeyDisplayName(pVirtualKeyCodesMapping[26]);
Ritor1
parents:
diff changeset
699 WriteWindowsRegistryString("KEY_FLYDOWN", v27);
Ritor1
parents:
diff changeset
700 v28 = GetVKeyDisplayName(pVirtualKeyCodesMapping[27]);
Ritor1
parents:
diff changeset
701 WriteWindowsRegistryString("KEY_LAND", v28);
Ritor1
parents:
diff changeset
702 v29 = GetVKeyDisplayName(pVirtualKeyCodesMapping[19]);
Ritor1
parents:
diff changeset
703 WriteWindowsRegistryString("KEY_ALWAYSRUN", v29);
Ritor1
parents:
diff changeset
704 }
Ritor1
parents:
diff changeset
705
Ritor1
parents:
diff changeset
706 //----- (0045ABCA) --------------------------------------------------------
Ritor1
parents:
diff changeset
707 const unsigned __int8 KeyboardActionMapping::GetActionDefaultVKey(const char *Str)
Ritor1
parents:
diff changeset
708 {
Ritor1
parents:
diff changeset
709 unsigned __int8 result; // al@3
Ritor1
parents:
diff changeset
710
Ritor1
parents:
diff changeset
711 if ( !strcmp(Str, "UP") )
Ritor1
parents:
diff changeset
712 return VK_UP;
Ritor1
parents:
diff changeset
713 if ( !strcmp(Str, "DOWN") )
Ritor1
parents:
diff changeset
714 return VK_DOWN;
Ritor1
parents:
diff changeset
715 if (!strcmp(Str, "") || !strcmp(Str, "LEFT"))
Ritor1
parents:
diff changeset
716 return VK_LEFT;
Ritor1
parents:
diff changeset
717 if (!strcmp(Str, "") || !strcmp(Str, "RIGHT"))
Ritor1
parents:
diff changeset
718 return VK_RIGHT;
Ritor1
parents:
diff changeset
719 if ( !strcmp(Str, "RETURN") )
Ritor1
parents:
diff changeset
720 return VK_RETURN;
Ritor1
parents:
diff changeset
721 if ( !strcmp(Str, "SPACE") )
Ritor1
parents:
diff changeset
722 return VK_SPACE;
Ritor1
parents:
diff changeset
723 if ( !strcmp(Str, "PAGE_DOWN") )
Ritor1
parents:
diff changeset
724 return VK_NEXT;
Ritor1
parents:
diff changeset
725 if ( !strcmp(Str, "PAGE_UP") )
Ritor1
parents:
diff changeset
726 return VK_PRIOR;
Ritor1
parents:
diff changeset
727 if ( !strcmp(Str, "TAB") )
Ritor1
parents:
diff changeset
728 return VK_TAB;
Ritor1
parents:
diff changeset
729 if ( !strcmp(Str, "SUBTRACT") )
Ritor1
parents:
diff changeset
730 return VK_SUBTRACT;
Ritor1
parents:
diff changeset
731 if ( !strcmp(Str, "ADD") )
Ritor1
parents:
diff changeset
732 return VK_ADD;
Ritor1
parents:
diff changeset
733 if ( !strcmp(Str, "END") )
Ritor1
parents:
diff changeset
734 return VK_END;
Ritor1
parents:
diff changeset
735 if ( !strcmp(Str, "DELETE") )
Ritor1
parents:
diff changeset
736 return VK_DELETE;
Ritor1
parents:
diff changeset
737 if ( !strcmp(Str, "HOME") )
Ritor1
parents:
diff changeset
738 return VK_HOME;
Ritor1
parents:
diff changeset
739 if ( !strcmp(Str, "INSERT") )
Ritor1
parents:
diff changeset
740 return VK_INSERT;
Ritor1
parents:
diff changeset
741 if ( strcmp(Str, "COMMA") )
Ritor1
parents:
diff changeset
742 {
Ritor1
parents:
diff changeset
743 if ( !strcmp(Str, "DECIMAL") )
Ritor1
parents:
diff changeset
744 return VK_DECIMAL;
Ritor1
parents:
diff changeset
745 if ( strcmp(Str, "SEMICOLON") )
Ritor1
parents:
diff changeset
746 {
Ritor1
parents:
diff changeset
747 if ( strcmp(Str, "PERIOD") )
Ritor1
parents:
diff changeset
748 {
Ritor1
parents:
diff changeset
749 if ( strcmp(Str, "SLASH") )
Ritor1
parents:
diff changeset
750 {
Ritor1
parents:
diff changeset
751 if ( strcmp(Str, "SQUOTE") )
Ritor1
parents:
diff changeset
752 {
Ritor1
parents:
diff changeset
753 if ( strcmp(Str, "BACKSLASH") )
Ritor1
parents:
diff changeset
754 {
Ritor1
parents:
diff changeset
755 if ( !strcmp(Str, "BACKSPACE") )
Ritor1
parents:
diff changeset
756 return VK_BACK;
Ritor1
parents:
diff changeset
757 if ( !strcmp(Str, "CONTROL") )
Ritor1
parents:
diff changeset
758 return VK_CONTROL;
Ritor1
parents:
diff changeset
759 if ( strlen(Str) != 1 || (result = *Str, (unsigned __int8)*Str < 0x41u) || result > 0x5Au )
Ritor1
parents:
diff changeset
760 result = -1;
Ritor1
parents:
diff changeset
761 }
Ritor1
parents:
diff changeset
762 else
Ritor1
parents:
diff changeset
763 {
Ritor1
parents:
diff changeset
764 result = -36;
Ritor1
parents:
diff changeset
765 }
Ritor1
parents:
diff changeset
766 }
Ritor1
parents:
diff changeset
767 else
Ritor1
parents:
diff changeset
768 {
Ritor1
parents:
diff changeset
769 result = -34;
Ritor1
parents:
diff changeset
770 }
Ritor1
parents:
diff changeset
771 }
Ritor1
parents:
diff changeset
772 else
Ritor1
parents:
diff changeset
773 {
Ritor1
parents:
diff changeset
774 result = -65;
Ritor1
parents:
diff changeset
775 }
Ritor1
parents:
diff changeset
776 }
Ritor1
parents:
diff changeset
777 else
Ritor1
parents:
diff changeset
778 {
Ritor1
parents:
diff changeset
779 result = -66;
Ritor1
parents:
diff changeset
780 }
Ritor1
parents:
diff changeset
781 }
Ritor1
parents:
diff changeset
782 else
Ritor1
parents:
diff changeset
783 {
Ritor1
parents:
diff changeset
784 result = -70;
Ritor1
parents:
diff changeset
785 }
Ritor1
parents:
diff changeset
786 }
Ritor1
parents:
diff changeset
787 else
Ritor1
parents:
diff changeset
788 {
Ritor1
parents:
diff changeset
789 result = -68;
Ritor1
parents:
diff changeset
790 }
Ritor1
parents:
diff changeset
791 return result;
Ritor1
parents:
diff changeset
792 }
Ritor1
parents:
diff changeset
793
Ritor1
parents:
diff changeset
794 //----- (0045AE2C) --------------------------------------------------------
Ritor1
parents:
diff changeset
795 const char *KeyboardActionMapping::GetVKeyDisplayName(signed int a1)
Ritor1
parents:
diff changeset
796 {
Ritor1
parents:
diff changeset
797 char *v3; // [sp-4h] [bp-8h]@2
Ritor1
parents:
diff changeset
798
Ritor1
parents:
diff changeset
799 static char static_sub_45AE2C_string_69ADE0[32];
Ritor1
parents:
diff changeset
800
Ritor1
parents:
diff changeset
801 if ( a1 == VK_UP )
Ritor1
parents:
diff changeset
802 {
Ritor1
parents:
diff changeset
803 v3 = "UP";
Ritor1
parents:
diff changeset
804 LABEL_53:
Ritor1
parents:
diff changeset
805 strcpy(static_sub_45AE2C_string_69ADE0, v3);
Ritor1
parents:
diff changeset
806 return static_sub_45AE2C_string_69ADE0;
Ritor1
parents:
diff changeset
807 }
Ritor1
parents:
diff changeset
808 if ( a1 == VK_DOWN )
Ritor1
parents:
diff changeset
809 {
Ritor1
parents:
diff changeset
810 v3 = "DOWN";
Ritor1
parents:
diff changeset
811 goto LABEL_53;
Ritor1
parents:
diff changeset
812 }
Ritor1
parents:
diff changeset
813 if ( a1 == VK_LEFT )
Ritor1
parents:
diff changeset
814 {
159
3235bc4cf78e NPCDialogue
Ritor1
parents: 150
diff changeset
815 v3 = "LEFT";
0
Ritor1
parents:
diff changeset
816 goto LABEL_53;
Ritor1
parents:
diff changeset
817 }
Ritor1
parents:
diff changeset
818 if ( a1 == VK_RIGHT )
Ritor1
parents:
diff changeset
819 {
159
3235bc4cf78e NPCDialogue
Ritor1
parents: 150
diff changeset
820 v3 = "RIGHT";
0
Ritor1
parents:
diff changeset
821 goto LABEL_53;
Ritor1
parents:
diff changeset
822 }
Ritor1
parents:
diff changeset
823 if ( a1 == VK_RETURN )
Ritor1
parents:
diff changeset
824 {
Ritor1
parents:
diff changeset
825 v3 = "RETURN";
Ritor1
parents:
diff changeset
826 goto LABEL_53;
Ritor1
parents:
diff changeset
827 }
Ritor1
parents:
diff changeset
828 if ( a1 == VK_SPACE )
Ritor1
parents:
diff changeset
829 {
Ritor1
parents:
diff changeset
830 v3 = "SPACE";
Ritor1
parents:
diff changeset
831 goto LABEL_53;
Ritor1
parents:
diff changeset
832 }
Ritor1
parents:
diff changeset
833 if ( a1 == VK_NEXT )
Ritor1
parents:
diff changeset
834 {
Ritor1
parents:
diff changeset
835 v3 = "PAGE_DOWN";
Ritor1
parents:
diff changeset
836 goto LABEL_53;
Ritor1
parents:
diff changeset
837 }
Ritor1
parents:
diff changeset
838 if ( a1 == VK_PRIOR )
Ritor1
parents:
diff changeset
839 {
Ritor1
parents:
diff changeset
840 v3 = "PAGE_UP";
Ritor1
parents:
diff changeset
841 goto LABEL_53;
Ritor1
parents:
diff changeset
842 }
Ritor1
parents:
diff changeset
843 if ( a1 == VK_TAB )
Ritor1
parents:
diff changeset
844 {
Ritor1
parents:
diff changeset
845 v3 = "TAB";
Ritor1
parents:
diff changeset
846 goto LABEL_53;
Ritor1
parents:
diff changeset
847 }
Ritor1
parents:
diff changeset
848 if ( a1 == 'm' )
Ritor1
parents:
diff changeset
849 {
Ritor1
parents:
diff changeset
850 v3 = "SUBTRACT";
Ritor1
parents:
diff changeset
851 goto LABEL_53;
Ritor1
parents:
diff changeset
852 }
Ritor1
parents:
diff changeset
853 if ( a1 == 'k' )
Ritor1
parents:
diff changeset
854 {
Ritor1
parents:
diff changeset
855 v3 = "ADD";
Ritor1
parents:
diff changeset
856 goto LABEL_53;
Ritor1
parents:
diff changeset
857 }
Ritor1
parents:
diff changeset
858 if ( a1 == VK_END )
Ritor1
parents:
diff changeset
859 {
Ritor1
parents:
diff changeset
860 v3 = "END";
Ritor1
parents:
diff changeset
861 goto LABEL_53;
Ritor1
parents:
diff changeset
862 }
Ritor1
parents:
diff changeset
863 if ( a1 == VK_DELETE )
Ritor1
parents:
diff changeset
864 {
Ritor1
parents:
diff changeset
865 v3 = "DELETE";
Ritor1
parents:
diff changeset
866 goto LABEL_53;
Ritor1
parents:
diff changeset
867 }
Ritor1
parents:
diff changeset
868 if ( a1 == VK_HOME )
Ritor1
parents:
diff changeset
869 {
Ritor1
parents:
diff changeset
870 v3 = "HOME";
Ritor1
parents:
diff changeset
871 goto LABEL_53;
Ritor1
parents:
diff changeset
872 }
Ritor1
parents:
diff changeset
873 if ( a1 == VK_INSERT )
Ritor1
parents:
diff changeset
874 {
Ritor1
parents:
diff changeset
875 v3 = "INSERT";
Ritor1
parents:
diff changeset
876 goto LABEL_53;
Ritor1
parents:
diff changeset
877 }
Ritor1
parents:
diff changeset
878 if ( a1 == VK_DECIMAL )
Ritor1
parents:
diff changeset
879 {
Ritor1
parents:
diff changeset
880 v3 = "DECIMAL";
Ritor1
parents:
diff changeset
881 goto LABEL_53;
Ritor1
parents:
diff changeset
882 }
Ritor1
parents:
diff changeset
883 if ( a1 == VK_OEM_COMMA )
Ritor1
parents:
diff changeset
884 {
Ritor1
parents:
diff changeset
885 v3 = "COMMA";
Ritor1
parents:
diff changeset
886 goto LABEL_53;
Ritor1
parents:
diff changeset
887 }
Ritor1
parents:
diff changeset
888 if ( a1 == VK_OEM_1 )
Ritor1
parents:
diff changeset
889 {
Ritor1
parents:
diff changeset
890 v3 = "SEMICOLON";
Ritor1
parents:
diff changeset
891 goto LABEL_53;
Ritor1
parents:
diff changeset
892 }
Ritor1
parents:
diff changeset
893 if ( a1 == VK_OEM_PERIOD )
Ritor1
parents:
diff changeset
894 {
Ritor1
parents:
diff changeset
895 v3 = "PERIOD";
Ritor1
parents:
diff changeset
896 goto LABEL_53;
Ritor1
parents:
diff changeset
897 }
Ritor1
parents:
diff changeset
898 if ( a1 == VK_OEM_2 )
Ritor1
parents:
diff changeset
899 {
Ritor1
parents:
diff changeset
900 v3 = "SLASH";
Ritor1
parents:
diff changeset
901 goto LABEL_53;
Ritor1
parents:
diff changeset
902 }
Ritor1
parents:
diff changeset
903 if ( a1 == VK_OEM_7 )
Ritor1
parents:
diff changeset
904 {
Ritor1
parents:
diff changeset
905 v3 = "SQUOTE";
Ritor1
parents:
diff changeset
906 goto LABEL_53;
Ritor1
parents:
diff changeset
907 }
Ritor1
parents:
diff changeset
908 if ( a1 == VK_OEM_5 )
Ritor1
parents:
diff changeset
909 {
Ritor1
parents:
diff changeset
910 v3 = "BACKSLASH";
Ritor1
parents:
diff changeset
911 goto LABEL_53;
Ritor1
parents:
diff changeset
912 }
Ritor1
parents:
diff changeset
913 if ( a1 == VK_CONTROL )
Ritor1
parents:
diff changeset
914 {
Ritor1
parents:
diff changeset
915 v3 = "CONTROL";
Ritor1
parents:
diff changeset
916 goto LABEL_53;
Ritor1
parents:
diff changeset
917 }
Ritor1
parents:
diff changeset
918 if ( a1 == VK_BACK )
Ritor1
parents:
diff changeset
919 {
Ritor1
parents:
diff changeset
920 v3 = "BACKSPACE";
Ritor1
parents:
diff changeset
921 goto LABEL_53;
Ritor1
parents:
diff changeset
922 }
Ritor1
parents:
diff changeset
923 if ( a1 < 65 || a1 > 90 )
Ritor1
parents:
diff changeset
924 {
Ritor1
parents:
diff changeset
925 v3 = "- -";
Ritor1
parents:
diff changeset
926 goto LABEL_53;
Ritor1
parents:
diff changeset
927 }
Ritor1
parents:
diff changeset
928 *(unsigned short *)static_sub_45AE2C_string_69ADE0 = (unsigned __int8)a1;
Ritor1
parents:
diff changeset
929 return static_sub_45AE2C_string_69ADE0;
Ritor1
parents:
diff changeset
930 }
Ritor1
parents:
diff changeset
931
Ritor1
parents:
diff changeset
932 //----- (0045AFD9) --------------------------------------------------------
Ritor1
parents:
diff changeset
933 Keyboard::Keyboard()
Ritor1
parents:
diff changeset
934 {
Ritor1
parents:
diff changeset
935 bUsingAsynKeyboard = false;
Ritor1
parents:
diff changeset
936
Ritor1
parents:
diff changeset
937 if (pVersion->pVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
Ritor1
parents:
diff changeset
938 pVersion->pVersionInfo.dwMajorVersion == 4)
Ritor1
parents:
diff changeset
939 bUsingAsynKeyboard = false;
Ritor1
parents:
diff changeset
940 }
Ritor1
parents:
diff changeset
941
Ritor1
parents:
diff changeset
942 //----- (0045B019) --------------------------------------------------------
Ritor1
parents:
diff changeset
943 void Keyboard::EnterCriticalSection()
Ritor1
parents:
diff changeset
944 {
Ritor1
parents:
diff changeset
945 }
Ritor1
parents:
diff changeset
946
Ritor1
parents:
diff changeset
947 //----- (0045B06E) --------------------------------------------------------
Ritor1
parents:
diff changeset
948 bool Keyboard::IsShiftHeld()
Ritor1
parents:
diff changeset
949 {
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
950 return GetAsyncKeyState(VK_SHIFT);
0
Ritor1
parents:
diff changeset
951 }
Ritor1
parents:
diff changeset
952
Ritor1
parents:
diff changeset
953 //----- (0045B0A9) --------------------------------------------------------
Ritor1
parents:
diff changeset
954 bool Keyboard::IsKeyBeingHeld(int vKey)
Ritor1
parents:
diff changeset
955 {
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
956 return GetAsyncKeyState(vKey) & 0x8001;
0
Ritor1
parents:
diff changeset
957 }
Ritor1
parents:
diff changeset
958
Ritor1
parents:
diff changeset
959 //----- (0045B0CE) --------------------------------------------------------
Ritor1
parents:
diff changeset
960 bool Keyboard::WasKeyPressed(int vKey)
Ritor1
parents:
diff changeset
961 {
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
962 return GetAsyncKeyState(vKey) & 1;
0
Ritor1
parents:
diff changeset
963 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
964 //----- (0046A14B) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
965 void OnPressSpace()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
966 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
967 //SHORT v0; // ax@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
968 int *v1; // eax@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
969 char *v2; // ebx@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
970 unsigned int v3; // esi@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
971 signed int v4; // edi@7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
972 unsigned int v5; // edx@7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
973 int v6; // ecx@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
974 int v7; // eax@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
975 int v8; // ecx@17
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
976 int *v9; // esi@22
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
977 signed int v10; // ebx@22
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
978 int i; // edi@23
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
979 int v12; // edx@24
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
980 int v13; // ecx@24
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
981 int j; // esi@28
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
982 int v16; // [sp+4h] [bp-1Ch]@0
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
983 char *v17; // [sp+8h] [bp-18h]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
984 unsigned int v18; // [sp+Ch] [bp-14h]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
985 int v19; // [sp+10h] [bp-10h]@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
986 int *v20; // [sp+14h] [bp-Ch]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
987 int *v21; // [sp+18h] [bp-8h]@7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
988 int v22; // [sp+1Ch] [bp-4h]@4
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
989
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
990 if ( pRenderer->pRenderD3D )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
991 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
992 pGame->PickKeyboard(GetAsyncKeyState(VK_CONTROL) & 0x8001, &vis_sprite_filter_3, &vis_door_filter);
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1828
diff changeset
993 int pid = pGame->pVisInstance->get_picked_object_zbuf_val();
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
994 if ( pid != -1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
995 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid));
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
996 return;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
997 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
998
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
999
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1000 // software render stuff following
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1001
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1002 static int dword_720660[100]; // 720660
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1003 static int dword_7207F0[100]; // 7207F0
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1004
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1005 v22 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1006 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1007 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1008 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1009 v2 = (char *)v1 - 50;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1010 v1 = (int *)((char *)v1 + 50);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1011 v3 = 640 * viewparams->uScreen_topL_Y;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1012 v17 = v2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1013 v20 = v1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1014 v18 = ((viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y - 1) >> 1) + 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1015 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1016 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1017 if ( (signed int)v2 < (signed int)v20 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1018 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1019 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1020 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1021 v4 = v22;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1022 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1023 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1024 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1025 v6 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1026 v7 = *v1 & 0xFFFF;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1027 v19 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1028 if ( v4 > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1029 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1030 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1031 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1032 if ( dword_7207F0[v6] == v7 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1033 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1034 ++v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1035 v19 = v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1036 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1037 while ( v6 < v22 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1038 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1039 if ( PID_TYPE(v7) == OBJECT_Decoration)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1040 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1041 v16 = (unsigned int)PID_ID(v7);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1042 if ( (signed int)(((unsigned int)*v21 >> 16)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1043 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)PID_ID(v7)].uDecorationDescID].uRadius) <= 512 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1044 if ( v19 == v22 && v4 < 100 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1045 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1046 ++v22;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1047 ++v4;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1048 v8 = *v21;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1049 dword_7207F0[v4 - 1] = v7;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1050 dword_720660[v4 - 1] = v8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1051 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1052 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1053 else if ( (unsigned int)*v21 <= 0x2000000 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1054 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1055 if ( v19 == v22 && v4 < 100 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1056 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1057 ++v22;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1058 ++v4;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1059 v8 = *v21;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1060 dword_7207F0[v4 - 1] = v7;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1061 dword_720660[v4 - 1] = v8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1062 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1063 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1064 v1 = v21 + 2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1065 --v5;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1066 v21 += 2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1067 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1068 while ( v5 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1069 v2 = v17;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1070 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1071 v3 += 1280;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1072 --v18;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1073 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1074 while ( v18 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1075 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1076 if ( v22 > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1077 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1078 v9 = dword_720660;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1079 v10 = 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1080 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1081 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1082 for ( i = v10; i < v22; ++i )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1083 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1084 v12 = *v9;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1085 v13 = dword_720660[i];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1086 if ( v13 < *v9 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1087 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1088 *v9 = v13;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1089 dword_720660[i] = v12;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1090 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1091 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1092 ++v10;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1093 ++v9;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1094 LOBYTE(v1) = v10 - 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1095 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1096 while ( v10 - 1 < v22 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1097 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1098 for ( j = 0; j < v22; ++j )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1099 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1100 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1101 if ( !(char)v1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1102 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1103 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
1104 }