File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
GeneralsMD/Code/GameEngine/Source/GameClient/Input
Generals/Code/GameEngine/Source/GameClient/Input Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -220,13 +220,14 @@ Bool Keyboard::checkKeyRepeat( void )
220220 // Scan Keyboard status array for first key down
221221 // long enough to repeat
222222 const UnsignedInt KEY_REPEAT_INTERVAL_MSEC = 67 ; // ~2 frames at 30 FPS
223- UnsignedInt now = timeGetTime ();
224223 for ( key = 0 ; key < ARRAY_SIZE (m_keyStatus); key++ )
225224 {
226225
227226 if ( BitIsSet ( m_keyStatus[ key ].state , KEY_STATE_DOWN ) )
228227 {
229228
229+ UnsignedInt now = timeGetTime ();
230+
230231 if ( now - m_keyStatus[ key ].keyDownTimeMsec > Keyboard::KEY_REPEAT_DELAY_MSEC )
231232 {
232233 // Add key to this frame
Original file line number Diff line number Diff line change @@ -220,13 +220,14 @@ Bool Keyboard::checkKeyRepeat( void )
220220 // Scan Keyboard status array for first key down
221221 // long enough to repeat
222222 const UnsignedInt KEY_REPEAT_INTERVAL_MSEC = 67 ; // ~2 frames at 30 FPS
223- UnsignedInt now = timeGetTime ();
224223 for ( key = 0 ; key < ARRAY_SIZE (m_keyStatus); key++ )
225224 {
226225
227226 if ( BitIsSet ( m_keyStatus[ key ].state , KEY_STATE_DOWN ) )
228227 {
229228
229+ UnsignedInt now = timeGetTime ();
230+
230231 if ( now - m_keyStatus[ key ].keyDownTimeMsec > Keyboard::KEY_REPEAT_DELAY_MSEC )
231232 {
232233 // Add key to this frame
You can’t perform that action at this time.
0 commit comments