Include press duration option and option to limit key press to OBS

This commit is contained in:
WarmUpTill
2021-09-18 19:35:59 +02:00
committed by WarmUpTill
parent aca9b84fc6
commit 7c6428b27e
7 changed files with 261 additions and 19 deletions

View File

@@ -524,7 +524,7 @@ static std::unordered_map<HotkeyType, long> keyTable = {
{HotkeyType::Key_NumpadEnter, XK_KP_Enter},
};
void PressKeys(const std::vector<HotkeyType> keys)
void PressKeys(const std::vector<HotkeyType> keys, int duration)
{
if (!canSimulateKeyPresses) {
return;
@@ -545,7 +545,7 @@ void PressKeys(const std::vector<HotkeyType> keys)
}
XFlush(display);
std::this_thread::sleep_for(std::chrono::milliseconds(300));
std::this_thread::sleep_for(std::chrono::milliseconds(duration));
// Release keys
for (auto &key : keys) {