-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: Disable hotkeys when typing or in modal dialog #7924
base: master
Are you sure you want to change the base?
Conversation
How did you test this? What operating systems did you test on? IIRC, focus events don't work the same on each OS, so it would be good to confirm that this behaves as intended on each. |
ad45e69
to
a9a1d09
Compare
This has now been tested on Linux and Windows without any problems. It just needs testing on macOS. |
0e26379
to
67d4d38
Compare
67d4d38
to
4efb4b3
Compare
Updated PR to also disable hotkeys when a modal dialog is open. |
So what is the underlying root cause of the issue? Because it doesn't seem like this was documented/explained anywhere (neither in this PR nor the original one). When OBS is in focus, hotkey management should be handled by Qt's own event loop and keyboard event handling, so are the key events not consumed by the editable widget? Are we intercepting the event before that and trigger the hotkey action before it's consumed? Wouldn't it be easier to only consume key events that have not been consumed by a widget ("leftover" events) and pass those to the hotkey system then? |
The main issue is that a user doesn't want a hotkey to trigger when they are typing in a editable widget. This PR, in my opinion, is simpler than using the event filter because it works for every widget. We would need to install an event filter to every single dialog and wouldn't work for plugins that have their own dialogs. At least that is my understanding of how the event filter works. |
4efb4b3
to
599f7b0
Compare
This disables hotkeys when an user is typing in an editable widget or a modal dialog is open.
599f7b0
to
cd083bc
Compare
Description
This disables hotkeys when an user is typing in a editable widget or a modal dialog is open.
Motivation and Context
Simpler version of #3072 (was reverted) and it automatically works with all widgets.
Fixes #7824
How Has This Been Tested?
Focused a editable widget and made sure the hotkeys didn't trigger. Also unfocused the same widget and made sure the hotkeys worked again. Also made sure hotkeys didn't trigger when opening a modal dialog.
Tested on Ubuntu 22.04 and Windows 10.
Types of changes
Checklist: