Skip to content

Commit

Permalink
ControllerEmu: Hide the cursor if the input gate is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokechu22 committed Dec 23, 2021
1 parent 6dae404 commit de7c78e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
Expand Up @@ -140,8 +140,11 @@ Cursor::StateData Cursor::GetState(const bool adjusted)

m_prev_result = result;

// If auto-hide time is up or hide button is held:
if (!m_auto_hide_timer || controls[4]->GetState<bool>())
// If auto-hide time is up, the hide button is held, or the input gate is disabled, hide the
// cursor. We need to check the input gate explicitly as the hide button check always returns
// false if the input gate is disabled (e.g. the window is not focused with background input
// disabled)
if (!m_auto_hide_timer || !ControlReference::GetInputGate() || controls[4]->GetState<bool>())
{
result.x = std::numeric_limits<ControlState>::quiet_NaN();
result.y = 0;
Expand Down

0 comments on commit de7c78e

Please sign in to comment.