@@ -46,9 +46,8 @@ CInput::CInput(bool exclusive, int deviceForInit)
46
46
MouseDelta = 25 ;
47
47
48
48
ZeroMemory (mouseState, sizeof (mouseState));
49
- ZeroMemory (KBState, sizeof (KBState));
50
- ZeroMemory (timeStamp, sizeof (timeStamp));
51
- ZeroMemory (timeSave, sizeof (timeStamp));
49
+ ZeroMemory (keyboardState, sizeof (keyboardState));
50
+ ZeroMemory (mouseTimeStamp, sizeof (mouseTimeStamp));
52
51
ZeroMemory (offs, sizeof (offs));
53
52
54
53
// ===================== Dummy pack
@@ -111,8 +110,8 @@ void CInput::MouseUpdate()
111
110
{
112
111
case SDL_MOUSEMOTION:
113
112
mouseMoved = true ;
114
- timeStamp [0 ] = dwCurTime + event.motion .timestamp ;
115
- timeStamp [1 ] = dwCurTime + event.motion .timestamp ;
113
+ mouseTimeStamp [0 ] = dwCurTime + event.motion .timestamp ;
114
+ mouseTimeStamp [1 ] = dwCurTime + event.motion .timestamp ;
116
115
offs[0 ] += event.motion .xrel ;
117
116
offs[1 ] += event.motion .yrel ;
118
117
break ;
@@ -126,8 +125,8 @@ void CInput::MouseUpdate()
126
125
break ;
127
126
case SDL_MOUSEWHEEL:
128
127
mouseMoved = true ;
129
- timeStamp [2 ] = dwCurTime + event.wheel .timestamp ;
130
- timeStamp [3 ] = dwCurTime + event.wheel .timestamp ;
128
+ mouseTimeStamp [2 ] = dwCurTime + event.wheel .timestamp ;
129
+ mouseTimeStamp [3 ] = dwCurTime + event.wheel .timestamp ;
131
130
offs[2 ] += event.wheel .y ;
132
131
offs[3 ] += event.wheel .x ;
133
132
break ;
@@ -158,10 +157,10 @@ void CInput::MouseUpdate()
158
157
}
159
158
else
160
159
{
161
- if (timeStamp [1 ] && dwCurTime - timeStamp [1 ] >= MouseDelta)
162
- cbStack.back ()->IR_OnMouseStop (0 , timeStamp [1 ] = 0 );
163
- if (timeStamp [0 ] && dwCurTime - timeStamp [0 ] >= MouseDelta)
164
- cbStack.back ()->IR_OnMouseStop (0 , timeStamp [0 ] = 0 );
160
+ if (mouseTimeStamp [1 ] && dwCurTime - mouseTimeStamp [1 ] >= MouseDelta)
161
+ cbStack.back ()->IR_OnMouseStop (0 , mouseTimeStamp [1 ] = 0 );
162
+ if (mouseTimeStamp [0 ] && dwCurTime - mouseTimeStamp [0 ] >= MouseDelta)
163
+ cbStack.back ()->IR_OnMouseStop (0 , mouseTimeStamp [0 ] = 0 );
165
164
}
166
165
}
167
166
@@ -175,19 +174,19 @@ void CInput::KeyUpdate()
175
174
case SDL_KEYDOWN:
176
175
if (event.key .repeat )
177
176
continue ;
178
- KBState [event.key .keysym .scancode ] = true ;
177
+ keyboardState [event.key .keysym .scancode ] = true ;
179
178
cbStack.back ()->IR_OnKeyboardPress (event.key .keysym .scancode );
180
179
break ;
181
180
182
181
case SDL_KEYUP:
183
- KBState [event.key .keysym .scancode ] = false ;
182
+ keyboardState [event.key .keysym .scancode ] = false ;
184
183
cbStack.back ()->IR_OnKeyboardRelease (event.key .keysym .scancode );
185
184
break ;
186
185
}
187
186
}
188
187
189
188
for (u32 i = 0 ; i < COUNT_KB_BUTTONS; ++i)
190
- if (KBState [i])
189
+ if (keyboardState [i])
191
190
cbStack.back ()->IR_OnKeyboardHold (i);
192
191
}
193
192
@@ -201,7 +200,7 @@ bool CInput::get_key_name(int dik, LPSTR dest_str, int dest_sz)
201
200
Msg (" ! cant convert dik_name for dik[%d]" , dik);
202
201
return false ;
203
202
}
204
- strcpy_s (dest_str, dest_sz, keyname);
203
+ xr_strcpy (dest_str, dest_sz, keyname);
205
204
}
206
205
207
206
return true ;
@@ -213,7 +212,7 @@ bool CInput::get_key_name(int dik, LPSTR dest_str, int dest_sz)
213
212
bool CInput::iGetAsyncKeyState (int dik)
214
213
{
215
214
if (dik < COUNT_KB_BUTTONS)
216
- return KBState [dik];
215
+ return keyboardState [dik];
217
216
218
217
if (dik >= MOUSE_1 && dik <= MOUSE_8)
219
218
{
@@ -255,8 +254,7 @@ void CInput::iCapture(IInputReceiver* p)
255
254
cbStack.back ()->IR_OnActivate ();
256
255
257
256
// prepare for _new_ controller
258
- ZeroMemory (timeStamp, sizeof (timeStamp));
259
- ZeroMemory (timeSave, sizeof (timeStamp));
257
+ ZeroMemory (mouseTimeStamp, sizeof (mouseTimeStamp));
260
258
ZeroMemory (offs, sizeof (offs));
261
259
}
262
260
@@ -290,9 +288,8 @@ void CInput::OnAppActivate(void)
290
288
291
289
SetAllAcquire (true );
292
290
ZeroMemory (mouseState, sizeof (mouseState));
293
- ZeroMemory (KBState, sizeof (KBState));
294
- ZeroMemory (timeStamp, sizeof (timeStamp));
295
- ZeroMemory (timeSave, sizeof (timeStamp));
291
+ ZeroMemory (keyboardState, sizeof (keyboardState));
292
+ ZeroMemory (mouseTimeStamp, sizeof (mouseTimeStamp));
296
293
ZeroMemory (offs, sizeof (offs));
297
294
}
298
295
@@ -303,9 +300,8 @@ void CInput::OnAppDeactivate(void)
303
300
304
301
SetAllAcquire (false );
305
302
ZeroMemory (mouseState, sizeof (mouseState));
306
- ZeroMemory (KBState, sizeof (KBState));
307
- ZeroMemory (timeStamp, sizeof (timeStamp));
308
- ZeroMemory (timeSave, sizeof (timeStamp));
303
+ ZeroMemory (keyboardState, sizeof (keyboardState));
304
+ ZeroMemory (mouseTimeStamp, sizeof (mouseTimeStamp));
309
305
ZeroMemory (offs, sizeof (offs));
310
306
}
311
307
0 commit comments