frontend: Disable hotkeys when typing or in modal dialog
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 https://github.com/obsproject/obs-studio/pull/3072 (was reverted) and it automatically works with all widgets.
Fixes https://github.com/obsproject/obs-studio/issues/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
- Bug fix (non-breaking change which fixes an issue)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.
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.
This has now been tested on Linux and Windows without any problems. It just needs testing on macOS.