| 342 | } |
| 343 | |
| 344 | MaaBool CustomKeyDown(int32_t keycode, void* trans_arg) |
| 345 | { |
| 346 | auto customCtx = reinterpret_cast<CustomControllerContext*>(trans_arg); |
| 347 | auto ctx = customCtx->callbacks["key_down"]; |
| 348 | return ctx->Call<bool>([&](maajs::FunctionType func) { |
| 349 | return func.Call( |
| 350 | { |
| 351 | maajs::NumberType::New(func.Env(), keycode), |
| 352 | }); |
| 353 | }); |
| 354 | } |
| 355 | |
| 356 | MaaBool CustomKeyUp(int32_t keycode, void* trans_arg) |
| 357 | { |