File tree Expand file tree Collapse file tree 4 files changed +4
-6
lines changed
GeneralsMD/Code/GameEngine Expand file tree Collapse file tree 4 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ struct KeyboardIO
8686class Keyboard : public SubsystemInterface
8787{
8888
89- enum { KEY_REPEAT_DELAY_MSEC = 333 };
89+ enum { KEY_REPEAT_DELAY_MSEC = 333 , KEY_REPEAT_INTERVAL_MSEC = 67 }; // ~2 frames at 30 FPS
9090
9191public:
9292
Original file line number Diff line number Diff line change @@ -219,7 +219,6 @@ Bool Keyboard::checkKeyRepeat( void )
219219
220220 // Scan Keyboard status array for first key down
221221 // long enough to repeat
222- const UnsignedInt KEY_REPEAT_INTERVAL_MSEC = 67 ; // ~2 frames at 30 FPS
223222 for ( key = 0 ; key < ARRAY_SIZE (m_keyStatus); key++ )
224223 {
225224
@@ -243,7 +242,7 @@ Bool Keyboard::checkKeyRepeat( void )
243242 m_keyStatus[ index ].keyDownTimeMsec = now;
244243
245244 // Set repeated key so it will repeat again after the interval
246- m_keyStatus[ key ].keyDownTimeMsec = now - (Keyboard::KEY_REPEAT_DELAY_MSEC + KEY_REPEAT_INTERVAL_MSEC);
245+ m_keyStatus[ key ].keyDownTimeMsec = now - (Keyboard::KEY_REPEAT_DELAY_MSEC + Keyboard:: KEY_REPEAT_INTERVAL_MSEC);
247246
248247 retVal = TRUE ;
249248 break ; // exit for key
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ struct KeyboardIO
8686class Keyboard : public SubsystemInterface
8787{
8888
89- enum { KEY_REPEAT_DELAY_MSEC = 333 };
89+ enum { KEY_REPEAT_DELAY_MSEC = 333 , KEY_REPEAT_INTERVAL_MSEC = 67 }; // ~2 frames at 30 FPS
9090
9191public:
9292
Original file line number Diff line number Diff line change @@ -219,7 +219,6 @@ Bool Keyboard::checkKeyRepeat( void )
219219
220220 // Scan Keyboard status array for first key down
221221 // long enough to repeat
222- const UnsignedInt KEY_REPEAT_INTERVAL_MSEC = 67 ; // ~2 frames at 30 FPS
223222 for ( key = 0 ; key < ARRAY_SIZE (m_keyStatus); key++ )
224223 {
225224
@@ -243,7 +242,7 @@ Bool Keyboard::checkKeyRepeat( void )
243242 m_keyStatus[ index ].keyDownTimeMsec = now;
244243
245244 // Set repeated key so it will repeat again after the interval
246- m_keyStatus[ key ].keyDownTimeMsec = now - (Keyboard::KEY_REPEAT_DELAY_MSEC + KEY_REPEAT_INTERVAL_MSEC);
245+ m_keyStatus[ key ].keyDownTimeMsec = now - (Keyboard::KEY_REPEAT_DELAY_MSEC + Keyboard:: KEY_REPEAT_INTERVAL_MSEC);
247246
248247 retVal = TRUE ;
249248 break ; // exit for key
You can’t perform that action at this time.
0 commit comments