mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 03:42:27 -05:00
Fall back to OBS-only key press if global key press can't be simulated
This commit is contained in:
@@ -484,7 +484,7 @@ AdvSceneSwitcher.action.hotkey.rightAlt="Right Alt"
|
||||
AdvSceneSwitcher.action.hotkey.leftMeta="Left Meta"
|
||||
AdvSceneSwitcher.action.hotkey.rightMeta="Right Meta"
|
||||
AdvSceneSwitcher.action.hotkey.onlyOBS="Send keypress only to OBS"
|
||||
AdvSceneSwitcher.action.hotkey.disabled="Cannot simulate key presses - functionality disabled!"
|
||||
AdvSceneSwitcher.action.hotkey.disabled="Cannot simulate global key presses - functionality limited to sending key press to OBS!"
|
||||
AdvSceneSwitcher.action.hotkey.entry="Press {{keys}} for {{duration}} milliseconds"
|
||||
AdvSceneSwitcher.action.sceneOrder="Scene item order"
|
||||
AdvSceneSwitcher.action.sceneOrder.type.moveUp="Move up"
|
||||
|
||||
@@ -225,7 +225,7 @@ bool MacroActionHotkey::PerformAction()
|
||||
|
||||
if (!keys.empty()) {
|
||||
int dur = _duration;
|
||||
if (_onlySendToObs) {
|
||||
if (_onlySendToObs || !canSimulateKeyPresses) {
|
||||
std::thread t([keys, dur]() { InjectKeys(keys, dur); });
|
||||
t.detach();
|
||||
} else {
|
||||
@@ -463,9 +463,10 @@ MacroActionHotkeyEdit::MacroActionHotkeyEdit(
|
||||
mainLayout->addLayout(line2Layout);
|
||||
mainLayout->addWidget(_onlySendToOBS);
|
||||
mainLayout->addWidget(_noKeyPressSimulationWarning);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
_onlySendToOBS->setEnabled(canSimulateKeyPresses);
|
||||
|
||||
_entryData = entryData;
|
||||
UpdateEntryData();
|
||||
_loading = false;
|
||||
@@ -493,7 +494,8 @@ void MacroActionHotkeyEdit::UpdateEntryData()
|
||||
_leftMeta->setChecked(_entryData->_leftMeta);
|
||||
_rightMeta->setChecked(_entryData->_rightMeta);
|
||||
_duration->setValue(_entryData->_duration);
|
||||
_onlySendToOBS->setChecked(_entryData->_onlySendToObs);
|
||||
_onlySendToOBS->setChecked(_entryData->_onlySendToObs ||
|
||||
!canSimulateKeyPresses);
|
||||
SetWarningVisibility();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user