UI: Add opt. to enable/disable in-focus hotkey blocking

Adds an option to enable/disable blocking hotkeys when the window is in
focus which is normally used in order to prevent hotkey/shortcut
conflicts.  This does not apply to the settings window; the hotkey
behavior is unchanged with the settings window (in order to prevent
hotkeys from being used while setting hotkeys for example).

Closes obsproject/obs-studio#1267
This commit is contained in:
jp9000
2018-05-06 16:48:27 -07:00
parent a75724d8a5
commit 051c58eeb7
5 changed files with 208 additions and 15 deletions

View File

@@ -73,6 +73,9 @@ private:
os_inhibit_t *sleepInhibitor = nullptr;
int sleepInhibitRefs = 0;
bool enableHotkeysInFocus = true;
std::deque<obs_frontend_translate_ui_cb> translatorHooks;
bool InitGlobalConfig();
@@ -80,6 +83,8 @@ private:
bool InitLocale();
bool InitTheme();
inline void ResetHotkeyState(bool inFocus);
public:
OBSApp(int &argc, char **argv, profiler_name_store_t *store);
~OBSApp();
@@ -87,6 +92,8 @@ public:
void AppInit();
bool OBSInit();
void EnableInFocusHotkeys(bool enable);
inline QMainWindow *GetMainWindow() const {return mainWindow.data();}
inline config_t *GlobalConfig() const {return globalConfig;}