@@ -231,9 +231,6 @@ class StickyKeyFilter
231
231
StickyKeyFilter ()
232
232
{
233
233
screensaverState = false ;
234
- SystemParametersInfo (SPI_GETSCREENSAVEACTIVE, 0 , &screensaverState, 0 );
235
- if (screensaverState)
236
- SystemParametersInfo (SPI_SETSCREENSAVEACTIVE, FALSE , nullptr , 0 );
237
234
stickyKeysFlags = 0 ;
238
235
filterKeysFlags = 0 ;
239
236
toggleKeysFlags = 0 ;
@@ -243,6 +240,15 @@ class StickyKeyFilter
243
240
stickyKeys.cbSize = sizeof (stickyKeys);
244
241
filterKeys.cbSize = sizeof (filterKeys);
245
242
toggleKeys.cbSize = sizeof (toggleKeys);
243
+ }
244
+
245
+ void initialize ()
246
+ {
247
+ SystemParametersInfo (SPI_GETSCREENSAVEACTIVE, 0 , &screensaverState, 0 );
248
+
249
+ if (screensaverState)
250
+ SystemParametersInfo (SPI_SETSCREENSAVEACTIVE, FALSE , nullptr , 0 );
251
+
246
252
SystemParametersInfo (SPI_GETSTICKYKEYS, sizeof (stickyKeys), &stickyKeys, 0 );
247
253
SystemParametersInfo (SPI_GETFILTERKEYS, sizeof (filterKeys), &filterKeys, 0 );
248
254
SystemParametersInfo (SPI_GETTOGGLEKEYS, sizeof (toggleKeys), &toggleKeys, 0 );
@@ -344,12 +350,10 @@ int RunApplication(pcstr commandLine)
344
350
xr_strcpy (Core.UserName , sizeof (Core.UserName ), " Player" );
345
351
xr_strcpy (Core.CompName , sizeof (Core.CompName ), " Computer" );
346
352
}
347
-
353
+
354
+ StickyKeyFilter filter;
348
355
if (GEnv.isDedicatedServer )
349
- {
350
- StickyKeyFilter filter;
351
- UNUSED (filter);
352
- }
356
+ filter.initialize ();
353
357
354
358
FPU::m24r ();
355
359
InitEngine ();
0 commit comments