pub type MaaWin32InputMethod = u64;Expand description
@brief Win32 input method
No bitwise OR, select ONE method only.
No default value. Client should choose one as default.
Different applications process input differently, there is no universal solution.
| Method | Compatibility | Require Admin | Seize Mouse | Background Support | Notes |
|---|---|---|---|---|---|
| Seize | High | No | Yes | No | |
| Medium | Maybe | No | Yes | ||
| PostMessage | Medium | Maybe | No | Yes | |
| No | Yes | No | PostThreadMessage | ||
| Low | Maybe | No | Yes | Deprecated | |
| SendMessageWithCursorPos | Medium | Maybe | Briefly | Yes | Moves cursor to target position, then |
| restores | PostMessageWithCursorPos | Medium | Maybe | Briefly | |
| to target position, then restores | SendMessageWithWindowPos | Medium | Maybe | No | |
| Moves window to align target with cursor, then restores | PostMessageWithWindowPos | Medium | Maybe | No | |
| Moves window to align target with cursor, then restores | Interception | Medium | Yes | No | |
| Driver-level input injection via the Interception driver | AnchoredTouch | Medium | Maybe | No | |
| Yes | Injects synthetic touch points, never moves the cursor |
Note:
- Admin rights mainly depend on the target application’s privilege level. If the target runs as admin, MaaFramework should also run as admin for compatibility.
- “WithCursorPos” methods briefly move the cursor to target position, send message, then restore cursor position. This “briefly” seizes the mouse but won’t block user operations.
- “WithWindowPos” methods briefly move the window so the target aligns with the current cursor position, send message, then restore the window position. The cursor is not moved.
- “AnchoredTouch” injects synthetic touch points without moving the cursor or the target window. The target receives WM_POINTER messages. Activation is suppressed during a touch sequence, but the target application can still bring itself to the foreground. Its existing window styles are preserved when the temporary activation styles are removed after the anchor is released. A target already in the foreground is not given these temporary activation styles. Each target point must be on an existing monitor; off-screen points are rejected. When the target point is occluded, the window is temporarily raised and made nearly invisible. While raised, it can take mouse clicks inside its rectangle from the windows underneath. The window is restored after the touch sequence. If it cannot be raised and made hit-testable at low opacity, the operation fails. Raising requires WS_EX_LAYERED. Windows layered via UpdateLayeredWindow are not supported. CS_OWNDC / CS_CLASSDC window classes produce a compatibility warning; the actual API results determine whether raising can proceed. Layered style added by this method may remain until inactive() or idle shutdown, and is retained if another module is using it. A minimized target must be restored before input. Screencap methods with pseudo-minimize do this before capture and can be used with AnchoredTouch. Clicking and swiping only. Keyboard can be routed to another method, but scroll cannot: it always goes through the mouse method and a synthetic touch device has no wheel.