#pragma once #include "variable-number.hpp" #include "variable-string.hpp" #include #include namespace advss { struct SourceInteractionStep { enum class Type { MOUSE_MOVE, MOUSE_CLICK, MOUSE_WHEEL, KEY_PRESS, TYPE_TEXT, WAIT, }; Type type = Type::MOUSE_MOVE; // Mouse fields NumberVariable x = 0; NumberVariable y = 0; obs_mouse_button_type button = MOUSE_LEFT; bool mouseUp = false; NumberVariable clickCount = 1; NumberVariable wheelDeltaX = 0; NumberVariable wheelDeltaY = 120; // Key / text fields NumberVariable nativeVkey = 0; uint32_t modifiers = 0; // INTERACT_* bool keyUp = false; StringVariable text; // for TYPE_TEXT or key text // Wait field (ms) NumberVariable waitMs = 100; bool Save(obs_data_t *obj) const; bool Load(obs_data_t *obj); std::string ToString() const; }; void PerformInteractionStep(obs_source_t *source, const SourceInteractionStep &step); } // namespace advss