File tree Expand file tree Collapse file tree 4 files changed +22
-6
lines changed
GameEngineDevice/Source/Win32Device/GameClient
GameEngine/Source/GameClient/Input
GameEngineDevice/Source/Win32Device/GameClient
GameEngine/Source/GameClient/Input Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ void Keyboard::updateKeys( void )
144144 // Update key down time for new key presses
145145 if ( BitIsSet ( m_keys[ index ].state , KEY_STATE_DOWN ) )
146146 {
147- m_keyStatus[ m_keys[ index ].key ].keyDownTimeMsec = timeGetTime () ;
147+ m_keyStatus[ m_keys[ index ].key ].keyDownTimeMsec = m_keys[ index ]. keyDownTimeMsec ;
148148 }
149149
150150 // prevent ALT-TAB from causing a TAB event
@@ -200,7 +200,7 @@ void Keyboard::updateKeys( void )
200200}
201201
202202// -------------------------------------------------------------------------------------------------
203- /* * check key repeat sequences , TRUE is returned if repeat is occurring */
203+ /* * check key repeat timing , TRUE is returned if repeat is occurring */
204204// -------------------------------------------------------------------------------------------------
205205Bool Keyboard::checkKeyRepeat ( void )
206206{
Original file line number Diff line number Diff line change @@ -319,7 +319,15 @@ void DirectInputKeyboard::getKey( KeyboardIO *key )
319319 // and not a bit set of the up/down state, this is the "start"
320320 // of building this "key"
321321 //
322- key->state = (( kbdat.dwData & 0x0080 ) ? KEY_STATE_DOWN : KEY_STATE_UP);
322+ if ( kbdat.dwData & 0x0080 )
323+ {
324+ key->state = KEY_STATE_DOWN;
325+ key->keyDownTimeMsec = kbdat.dwTimeStamp ;
326+ }
327+ else
328+ {
329+ key->state = KEY_STATE_UP;
330+ }
323331
324332 // set status as unused (unprocessed)
325333 key->status = KeyboardIO::STATUS_UNUSED;
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ void Keyboard::updateKeys( void )
144144 // Update key down time for new key presses
145145 if ( BitIsSet ( m_keys[ index ].state , KEY_STATE_DOWN ) )
146146 {
147- m_keyStatus[ m_keys[ index ].key ].keyDownTimeMsec = timeGetTime () ;
147+ m_keyStatus[ m_keys[ index ].key ].keyDownTimeMsec = m_keys[ index ]. keyDownTimeMsec ;
148148 }
149149
150150 // prevent ALT-TAB from causing a TAB event
@@ -200,7 +200,7 @@ void Keyboard::updateKeys( void )
200200}
201201
202202// -------------------------------------------------------------------------------------------------
203- /* * check key repeat sequences , TRUE is returned if repeat is occurring */
203+ /* * check key repeat timing , TRUE is returned if repeat is occurring */
204204// -------------------------------------------------------------------------------------------------
205205Bool Keyboard::checkKeyRepeat ( void )
206206{
Original file line number Diff line number Diff line change @@ -319,7 +319,15 @@ void DirectInputKeyboard::getKey( KeyboardIO *key )
319319 // and not a bit set of the up/down state, this is the "start"
320320 // of building this "key"
321321 //
322- key->state = (( kbdat.dwData & 0x0080 ) ? KEY_STATE_DOWN : KEY_STATE_UP);
322+ if ( kbdat.dwData & 0x0080 )
323+ {
324+ key->state = KEY_STATE_DOWN;
325+ key->keyDownTimeMsec = kbdat.dwTimeStamp ;
326+ }
327+ else
328+ {
329+ key->state = KEY_STATE_UP;
330+ }
323331
324332 // set status as unused (unprocessed)
325333 key->status = KeyboardIO::STATUS_UNUSED;
You can’t perform that action at this time.
0 commit comments