}, { {"clockwise", true}, {"multiplicity", 1} } };
};
variables["TURN_WHEEL"] = generateWheelTurnFunction();
+
+ auto generateKeyPressFunction = [&]() {
+ return EvaluationValueFunction{ [&](std::string keyId, unsigned multiplicity, double hold_time) -> EvaluationValue {
+
+ if (keyId == "")
+ throw EvaluationFailure{} << "Invalid keyId";
+
+ if (multiplicity <= 0)
+ throw EvaluationFailure{} << "Invalid multiplicity (must be more that 0)";
+
+ if (hold_time < 0)
+ throw EvaluationFailure{} << "Invalid hold time (must be more or equal 0)";
+
+ executeOnMainThread([&]()
+ {
+ utils::generateKeyPress(keyId, multiplicity, hold_time);
+ });
+
+ std::this_thread::sleep_for(std::chrono::milliseconds{ 800 });
+
+ return EvaluationValue{};
+ }, { {"keyId" }, {"multiplicity", 1 }, {"holdTime", 0} } };
+ };
+ variables["PRESS_KEY"] = generateKeyPressFunction();
}
class PredicateWaitInterface : public EvaluationValueWaitInterface