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

Function MaaGamepadControllerCreate

source/MaaFramework/API/MaaFramework.cpp:242–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242MaaController* MaaGamepadControllerCreate(void* hWnd, MaaGamepadType gamepad_type, MaaWin32ScreencapMethod screencap_method)
243{
244 LogFunc << VAR_VOIDP(hWnd) << VAR(gamepad_type) << VAR(screencap_method);
245
246#ifndef _WIN32
247
248 LogError << "This API " << __FUNCTION__ << " is only available on Windows";
249 return nullptr;
250
251#else
252
253 auto control_unit = MAA_NS::GamepadControlUnitLibraryHolder::create_control_unit(hWnd, gamepad_type, screencap_method);
254
255 if (!control_unit) {
256 LogError << "Failed to create control unit";
257 return nullptr;
258 }
259
260 return new MAA_CTRL_NS::ControllerAgent(std::move(control_unit));
261#endif
262}
263
264MaaController* MaaWlRootsControllerCreate(const char* wlr_socket_path, MaaBool use_win32_vk_code)
265{

Callers 2

ctorMethod · 0.50
runMethod · 0.50

Calls 1

moveFunction · 0.85

Tested by

no test coverage detected