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

Function CustomSwipe

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

Source from the content-addressed store, hash-verified

260}
261
262MaaBool CustomSwipe(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t duration, void* trans_arg)
263{
264 auto customCtx = reinterpret_cast<CustomControllerContext*>(trans_arg);
265 auto ctx = customCtx->callbacks["swipe"];
266 return ctx->Call<bool>([&](maajs::FunctionType func) {
267 return func.Call(
268 {
269 maajs::NumberType::New(func.Env(), x1),
270 maajs::NumberType::New(func.Env(), y1),
271 maajs::NumberType::New(func.Env(), x2),
272 maajs::NumberType::New(func.Env(), y2),
273 maajs::NumberType::New(func.Env(), duration),
274 });
275 });
276}
277
278MaaBool CustomTouchDown(int32_t contact, int32_t x, int32_t y, int32_t pressure, void* trans_arg)
279{

Callers

nothing calls this directly

Calls 2

CallMethod · 0.45
EnvMethod · 0.45

Tested by

no test coverage detected