提交 9ca1e85f 编写于 作者: J jp9000

UI: Fix hotkeys working even when disabled in focus

Fixes a bug where the hotkey inject would trigger hotkeys despite
hotkeys being disabled when in focus.
上级 887857b7
......@@ -93,6 +93,9 @@ QObject *CreateShortcutFilter()
{
return new OBSEventFilter([](QObject *obj, QEvent *event) {
auto mouse_event = [](QMouseEvent &event) {
if (!App()->HotkeysEnabledInFocus())
return true;
obs_key_combination_t hotkey = {0, OBS_KEY_NONE};
bool pressed = event.type() == QEvent::MouseButtonPress;
......@@ -147,6 +150,9 @@ QObject *CreateShortcutFilter()
};
auto key_event = [&](QKeyEvent *event) {
if (!App()->HotkeysEnabledInFocus())
return true;
QDialog *dialog = qobject_cast<QDialog *>(obj);
obs_key_combination_t hotkey = {0, OBS_KEY_NONE};
......
......@@ -107,6 +107,11 @@ public:
void EnableInFocusHotkeys(bool enable);
inline bool HotkeysEnabledInFocus() const
{
return enableHotkeysInFocus;
}
inline QMainWindow *GetMainWindow() const { return mainWindow.data(); }
inline config_t *GlobalConfig() const { return globalConfig; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册