File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Generals/Code/GameEngine/Source/GameClient/Input Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,9 @@ void Keyboard::updateKeys( void )
130130 }
131131 while ( m_keys[ index++ ].key != KEY_NONE );
132132
133+ // Get current time once for all key updates
134+ UnsignedInt now = 0 ;
135+
133136 // update keyboard status array
134137 index = 0 ;
135138 while ( m_keys[ index ].key != KEY_NONE )
@@ -145,7 +148,9 @@ void Keyboard::updateKeys( void )
145148 // Update key down time for new key presses
146149 if ( BitIsSet ( m_keys[ index ].state , KEY_STATE_DOWN ) )
147150 {
148- m_keyStatus[ m_keys[ index ].key ].keyDownTimeMsec = timeGetTime ();
151+ if ( !now )
152+ now = timeGetTime ();
153+ m_keyStatus[ m_keys[ index ].key ].keyDownTimeMsec = now;
149154 }
150155
151156 // prevent ALT-TAB from causing a TAB event
You can’t perform that action at this time.
0 commit comments