MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / CustomGetFeatures

Function CustomGetFeatures

source/binding/NodeJS/src/apis/callback.cpp:179–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179MaaControllerFeature CustomGetFeatures(void* trans_arg)
180{
181 using Ret = std::optional<std::vector<std::string>>;
182 auto customCtx = reinterpret_cast<CustomControllerContext*>(trans_arg);
183 auto ctx = customCtx->callbacks["get_features"];
184 auto result = ctx->Call<Ret>([&](maajs::FunctionType func) { return func.Call({ }); });
185 if (!result) {
186 return 0;
187 }
188
189 MaaControllerFeature ret = 0;
190 for (auto key : *result) {
191 if (key == "mouse") {
192 ret |= MaaControllerFeature_UseMouseDownAndUpInsteadOfClick;
193 }
194 else if (key == "keyboard") {
195 ret |= MaaControllerFeature_UseKeyboardDownAndUpInsteadOfClick;
196 }
197 }
198 return ret;
199}
200
201MaaBool CustomStartApp(const char* intent, void* trans_arg)
202{

Callers

nothing calls this directly

Calls 1

CallMethod · 0.45

Tested by

no test coverage detected