pub unsafe extern "C" fn MaaKWinControllerCreate(
device_node: *const c_char,
screen_width: c_int,
screen_height: c_int,
use_win32_vk_code: MaaBool,
) -> *mut MaaControllerExpand description
@brief Create a KWin / Linux Wayland controller via PipeWire and /dev/uinput.
Despite the name “KWin”, this controller works with any Wayland compositor that implements the XDG Screencast Portal and kernel has uinput support (e.g., GNOME).
@param device_node The uinput device node path (e.g., “/dev/uinput”). @param screen_width The screen width in pixels. @param screen_height The screen height in pixels. @param use_win32_vk_code If true, key codes passed to click_key / key_down / key_up are interpreted as Win32 Virtual-Key codes (VK_*) and translated to Linux evdev codes internally. If false, key codes are passed through as raw evdev codes. @return The controller handle, or nullptr on failure.
@note Dependencies: pipewire (1.0+), xdg-desktop-portal. @note Screencap is implemented via PipeWire / xdg-desktop-portal. @note Input is simulated via /dev/uinput (kernel-level virtual input devices). @note Requires user authorization via the screen sharing dialog (xdg-desktop-portal). @note Requires write permission to /dev/uinput (typically via the “input” group). It is recommended to configure a udev rule: KERNEL==“uinput”, MODE=“0660”, GROUP=“input”.