| 262 | } |
| 263 | |
| 264 | MaaController* MaaWlRootsControllerCreate(const char* wlr_socket_path, MaaBool use_win32_vk_code) |
| 265 | { |
| 266 | LogFunc << VAR(wlr_socket_path) << VAR(use_win32_vk_code); |
| 267 | |
| 268 | #ifndef __linux__ |
| 269 | |
| 270 | LogError << "This API " << __FUNCTION__ << " is only available on Linux"; |
| 271 | return nullptr; |
| 272 | |
| 273 | #else |
| 274 | |
| 275 | auto control_unit = MAA_NS::WlRootsControlUnitLibraryHolder::create_control_unit(wlr_socket_path, use_win32_vk_code); |
| 276 | |
| 277 | if (!control_unit) { |
| 278 | LogError << "Failed to create control unit"; |
| 279 | return nullptr; |
| 280 | } |
| 281 | |
| 282 | return new MAA_CTRL_NS::ControllerAgent(std::move(control_unit)); |
| 283 | #endif |
| 284 | } |
| 285 | |
| 286 | MaaController* MaaKWinControllerCreate(const char* device_node, int screen_width, int screen_height, MaaBool use_win32_vk_code) |
| 287 | { |