MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / InjectKeys

Function InjectKeys

plugins/base/macro-action-hotkey.cpp:207–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207static void InjectKeys(const std::vector<HotkeyType> &keys, int duration)
208{
209 auto combo = keysToOBSKeycombo(keys);
210 if (obs_key_combination_is_empty(combo)) {
211 return;
212 }
213 // I am not sure why this is necessary
214 obs_hotkey_inject_event(combo, false);
215
216 obs_hotkey_inject_event(combo, true);
217 std::this_thread::sleep_for(std::chrono::milliseconds(duration));
218 obs_hotkey_inject_event(combo, false);
219}
220
221static void addNamePrefix(std::string &name, obs_hotkey_t *hotkey)
222{

Callers 1

SendCustomHotkeyMethod · 0.85

Calls 1

keysToOBSKeycomboFunction · 0.85

Tested by

no test coverage detected