diff options
author | Garrett Brown <themagnificentmrb@gmail.com> | 2024-02-14 12:18:02 -0800 |
---|---|---|
committer | Garrett Brown <themagnificentmrb@gmail.com> | 2024-02-14 16:45:55 -0800 |
commit | cd50648fd524544bf07f0e0f301bc7a05203fdad (patch) | |
tree | fd6ac710e4d2b830f12b8c0594f536263d9c2110 | |
parent | 1fe00e470f610c4ae253e3f4e3d653aa4fa0739d (diff) |
Revert "[Joysticks] Fix mapping PS4 trigger analog semiaxes"
This reverts commit 1021ea1ef18ea745bb77fd3fa4d89f5040b3ee87.
-rw-r--r-- | xbmc/input/joysticks/generic/ButtonMapping.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/xbmc/input/joysticks/generic/ButtonMapping.cpp b/xbmc/input/joysticks/generic/ButtonMapping.cpp index 03faf73926..4b5dd8aca5 100644 --- a/xbmc/input/joysticks/generic/ButtonMapping.cpp +++ b/xbmc/input/joysticks/generic/ButtonMapping.cpp @@ -451,34 +451,31 @@ bool CButtonMapping::MapPrimitive(const CDriverPrimitive& primitive) { bool bHandled = false; - if (m_buttonMap->IsIgnored(primitive)) + auto now = std::chrono::steady_clock::now(); + + bool bTimeoutElapsed = true; + + if (m_buttonMapper->NeedsCooldown()) + bTimeoutElapsed = (now >= m_lastAction + std::chrono::milliseconds(MAPPING_COOLDOWN_MS)); + + if (bTimeoutElapsed) + { + bHandled = m_buttonMapper->MapPrimitive(m_buttonMap, m_keymap, primitive); + + if (bHandled) + m_lastAction = std::chrono::steady_clock::now(); + } + else if (m_buttonMap->IsIgnored(primitive)) { bHandled = true; } else { - auto now = std::chrono::steady_clock::now(); - - bool bTimeoutElapsed = true; - - if (m_buttonMapper->NeedsCooldown()) - bTimeoutElapsed = (now >= m_lastAction + std::chrono::milliseconds(MAPPING_COOLDOWN_MS)); + auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now - m_lastAction); - if (bTimeoutElapsed) - { - bHandled = m_buttonMapper->MapPrimitive(m_buttonMap, m_keymap, primitive); - - if (bHandled) - m_lastAction = std::chrono::steady_clock::now(); - } - else - { - auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now - m_lastAction); - - CLog::Log(LOGDEBUG, "Button mapping: rapid input after {}ms dropped for profile \"{}\"", - duration.count(), m_buttonMapper->ControllerID()); - bHandled = true; - } + CLog::Log(LOGDEBUG, "Button mapping: rapid input after {}ms dropped for profile \"{}\"", + duration.count(), m_buttonMapper->ControllerID()); + bHandled = true; } return bHandled; |