Add option to disable registering of pause control hotkeys

This commit is contained in:
WarmUpTill
2022-05-04 15:17:44 +02:00
committed by WarmUpTill
parent 22a361f977
commit b5eb0b3f3e
6 changed files with 57 additions and 9 deletions

View File

@@ -1,10 +1,12 @@
#pragma once
#include "macro.hpp"
#include <QWidget>
#include <QDialog>
#include <QCheckBox>
#include <obs-data.h>
// Global macro properties
class MacroProperties {
public:
void Save(obs_data_t *obj);
@@ -15,15 +17,19 @@ public:
bool _highlightActions = false;
};
// Dialog for configuring global and macro specific settings
class MacroPropertiesDialog : public QDialog {
Q_OBJECT
public:
MacroPropertiesDialog(QWidget *parent, const MacroProperties &);
static bool AskForSettings(QWidget *parent, MacroProperties &userInput);
MacroPropertiesDialog(QWidget *parent, const MacroProperties &,
Macro *macro);
static bool AskForSettings(QWidget *parent, MacroProperties &userInput,
Macro *macro);
private:
QCheckBox *_executed;
QCheckBox *_conditions;
QCheckBox *_actions;
QCheckBox *_hotkeys;
};

View File

@@ -114,6 +114,9 @@ public:
bool OnChangePreventedActionsRecently();
void ResetUIHelpers();
void EnablePauseHotkeys(bool);
bool PauseHotkeysEnabled();
private:
void SetupHotkeys();
void ClearHotkeys();
@@ -132,6 +135,7 @@ private:
bool _matchOnChange = false;
bool _paused = false;
int _count = 0;
bool _registerHotkeys = true;
obs_hotkey_id _pauseHotkey = OBS_INVALID_HOTKEY_ID;
obs_hotkey_id _unpauseHotkey = OBS_INVALID_HOTKEY_ID;
obs_hotkey_id _togglePauseHotkey = OBS_INVALID_HOTKEY_ID;