Skip to content

Conversation

Dentomologist
Copy link
Contributor

Suppress hotkeys, controller inputs, and Free Look inputs when a widget that takes text input has focus. This is most directly useful when using various debugger widgets, but applies throughout Dolphin.

The specific widgets affected are QLineEdit, QTextEdit, QAbstractSpinBox, and QComboBox, as well as any class that has one of those as a base class.

A few related changes:

  • Input suppression is tracked with a counter instead of a bool. This prevents cases where, when switching focus between two input-suppressing widgets, the focus-in event of the new focus widget enabled suppression followed by the focus-out event of the old focus widget disabled suppression.
  • The suppression counter is now atomic to prevent data races.
  • When a window suppresses input it now also suppresses controller and Free Look input instead of just hotkeys.
  • Remove input suppression from the Controllers and Free Look Settings windows, since I don't see a need for those to block input unless a text field is focused. DolphinFileDialog and MappingWindow still suppress input while they're open, since users should be able to use the mapping indicator lights to check their config without triggering other inputs.

I've tested that movie recording inputs play back properly even when a text field is focused during playback. I haven't tested NetPlay inputs from other players.

Remove input suppression from the Settings and Free Look Settings
windows.

In an upcoming commit input suppression will be added to individual
text fields, so there won't be a need to suppress inputs for the whole
time those windows are open. Removing the suppression from these windows
now reduces commit noise as various refactorings happen.

Keep input suppression for the mapping windows, since users should be
able to check their mappings via the indicator lights without causing
other inputs.

The removed call to install a WindowActivationEventFilter on
MainWindow::m_hotkey_window was redundant with the filter installed in
MappingWindow's constructor.
Use an atomic integer to track the hotkey suppression count instead of a
boolean. This allows for nested suppressions without having to worry
about the order of window activations and deactivations, and making it
atomic fixes a potential data race between the Host and Hotkey Scheduler
threads.

Previously if you had a window that disabled hotkeys focused (such as the
Controllers pane in the Settings window) then opened another such window
(such as a controller mapping window), the focus-in event for the new
window would disable hotkeys again, followed by the focus-out event for
the first window enabling them.
Include InputCommon/InputConfig.h directly in MainWindow.cpp instead of
indirectly via Core/HotkeyManager.h.
In an upcoming commit input suppression will be added for Free Look and
controller inputs. Use an independent class instead of having those
input channels call HotkeyManagerEmu::IsSuppressed.
Adjust #includes and forward declarations and use the DolphinFileDialog
namespace in the .cpp file instead of prefixing each function.
Add filters to automatically add a suppression on hotkey, Free Look, and
controller inputs when a widget with meaningful text input gains focus,
then remove the suppression when that widget loses focus.

Specifically this applies to QLineEdits, QTextEdits, QAbstractSpinBoxes,
and QComboBoxes, as well as any class deriving from one of those.
@Dentomologist Dentomologist force-pushed the suppress_inputs_when_text_fields_have_focus branch from 68b8051 to b4ce45b Compare October 5, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants