mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
InputSystem: fix controller hold keys not working
Should've been !keyInfo.m_bKeyDown.
This commit is contained in:
parent
b618daa694
commit
d592bb2241
@ -121,12 +121,12 @@ void CGame::GetWindowRect(int* const x, int* const y, int* const w, int* const h
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: dispatch key event
|
||||
//-----------------------------------------------------------------------------
|
||||
void CGame::DispatchKeyEvent(const uint64_t msTime, const ButtonCode_t buttonCode) const
|
||||
void CGame::DispatchKeyEvent(const uint64_t currentTick, const ButtonCode_t buttonCode) const
|
||||
{
|
||||
const float duration = buttonCode == KEY_XBUTTON_BACK ? 1.0f : 0.2f;
|
||||
const float delay = buttonCode == KEY_XBUTTON_BACK ? 1.0f : 0.2f;
|
||||
KeyInfo_t& keyInfo = g_pKeyInfo[buttonCode];
|
||||
|
||||
if (keyInfo.m_bKeyDown && ((msTime - keyInfo.m_nEventTick) * 0.001f) >= duration)
|
||||
if (!keyInfo.m_bKeyDown && ((currentTick - keyInfo.m_nEventTick) * 0.001f) >= delay)
|
||||
{
|
||||
KeyEvent_t keyEvent;
|
||||
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
inline float GetTVRefreshRate() const // Avoid stutter on TV's running on broadcast frame rates.
|
||||
{ return ((float)m_iDesktopRefreshRate == 59.0f || (float)m_iDesktopRefreshRate == 60.0f) ? 59.939999f : (float)m_iDesktopRefreshRate; }
|
||||
|
||||
void DispatchKeyEvent(const uint64_t msTime, const ButtonCode_t buttonCode) const;
|
||||
void DispatchKeyEvent(const uint64_t currentTick, const ButtonCode_t buttonCode) const;
|
||||
void DispatchAllStoredGameMessages() const;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user