| 260 | } |
| 261 | |
| 262 | MaaBool 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 | |
| 278 | MaaBool CustomTouchDown(int32_t contact, int32_t x, int32_t y, int32_t pressure, void* trans_arg) |
| 279 | { |