|
1 | 1 | # FastGhostMouse Reference |
2 | 2 |
|
3 | | -## 1. Native Overlay Engine |
4 | | -* **WS_EX_TRANSPARENT**: The overlay window is mathematically ignored by the Windows input subsystem. Mouse clicks and keyboard events pass directly through to the underlying application. |
5 | | -* **WS_EX_NOACTIVATE**: The overlay will never steal window focus from your active game, application, or browser, ensuring automation bots are not interrupted. |
6 | | -* **WS_EX_LAYERED**: Enables per-pixel alpha transparency and high-performance image blending via standard Windows APIs. |
7 | | - |
8 | | -## 2. API Capabilities |
9 | | -* **useAsSecondaryMouse(x, y, index)**: Captures the active Windows cursor and seamlessly integrates it into a secondary, scriptable hardware cursor. |
10 | | -* **moveTo(x, y)**: Initiates a hardware-accelerated, interpolated movement to the target coordinates. |
11 | | -* **setSmoothing(factor)**: Adjusts the momentum and easing of the cursor. Lower values produce heavier, more human-like drag, while higher values snap instantly. |
12 | | -* **setTextImage**: Attaches dynamic visual text or labels directly beneath the cursor (e.g., "Executing AI Action"). |
13 | | - |
14 | | -## 3. FastCore & FastOverlay Bindings |
15 | | -* **JNI Hooks**: `FastGhostMouse` relies on the unified `FastCore` JNI loader to access `FastOverlayWindow` instances. |
16 | | -* **Zero Swing/AWT Logic**: The overlay bypasses the Java Event Dispatch Thread (EDT) completely, preventing UI locks or stutters during complex bot logic. |
17 | | - |
18 | | -## 4. Platform Support |
19 | | -| Platform | Status | |
20 | | -|----------|--------| |
21 | | -| Windows 10/11 (x64) | ✅ Fully Supported | |
22 | | -| Linux | 🚧 Planned (X11/Wayland hooks) | |
23 | | -| macOS | 🚧 Planned | |
| 3 | +## 1. Native Architecture & Subsystems |
| 4 | + |
| 5 | +`FastGhostMouse` provides a hardware-accelerated, transparent ghost cursor overlay for AI agent trajectory visualization, automation debugging, and bot telemetry. |
| 6 | + |
| 7 | +It directly composites two native `FastOverlayWindow` surfaces via DirectComposition / DWM: |
| 8 | +1. **Cursor Window**: Renders either a custom high-DPI `BufferedImage` or the captured Windows OS hardware cursor (`captureSystemCursor()`). |
| 9 | +2. **Text Label Window**: Renders dynamic HUD status text or AI state labels directly offset next to the cursor without affecting OS hit testing. |
| 10 | + |
| 11 | +Both windows enforce the following Win32 styles: |
| 12 | +* `WS_EX_TRANSPARENT`: Mathematically transparent to the Windows input subsystem. Mouse and keyboard events pass directly to windows below. |
| 13 | +* `WS_EX_NOACTIVATE`: Never receives or steals window focus, guaranteeing target application continuity. |
| 14 | +* `WS_EX_LAYERED`: Sub-millisecond alpha blending and per-pixel transparency composited directly by the Desktop Window Manager (DWM). |
24 | 15 |
|
25 | 16 | --- |
26 | | -**Part of the FastJava Ecosystem** — *Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋* |
| 17 | + |
| 18 | +## 2. API Reference |
| 19 | + |
| 20 | +### `FastGhostMouse` |
| 21 | + |
| 22 | +| Method | Signature | Description | Native / Subsystem Call | |
| 23 | +|:---|:---|:---|:---| |
| 24 | +| `init(startX, startY)` | `void` | Spawns dual `FastOverlayWindow` handles at coordinates and starts the 120 FPS physics loop. | `FastOverlay.createWindow` | |
| 25 | +| `useAsSecondaryMouse(x, y, index)` | `void` | Spawns cursor, captures current OS hardware cursor, and displays overlay. | `captureSystemCursor()`, `show()` | |
| 26 | +| `moveTo(targetX, targetY)` | `void` | Sets target coordinates for smooth physics-based cursor interpolation. | Internal delta-time Euler integration | |
| 27 | +| `setCursorPositionImmediate(x, y)` | `void` | Instantly teleports the cursor overlay without animation delay. | `FastOverlayWindow.setPosition` | |
| 28 | +| `setSmoothing(factor)` | `void` | Configures momentum and easing responsiveness (default: `0.12f`). | Animation physics coefficient | |
| 29 | +| `setTextOffset(dx, dy)` | `void` | Configures pixel offset of the status label window relative to cursor tip. | Win32 layout translation | |
| 30 | +| `setCursorImage(img)` | `void` | Applies custom `BufferedImage` icon to the cursor overlay surface. | `FastOverlayWindow.updateImage` | |
| 31 | +| `setTextImage(img)` | `void` | Applies custom `BufferedImage` rendered label next to cursor. | `FastOverlayWindow.updateImage` | |
| 32 | +| `captureSystemCursor()` | `void` | Queries native Win32 `GetCursorInfo` and extracts current OS cursor bitmap. | `captureSystemCursorNative` (JNI) | |
| 33 | +| `setSystemCursorVisible(visible)` | `void` | Dynamically hides or restores the OS hardware cursor via Win32 `SetSystemCursor`. | `setSystemCursorVisible` (JNI) | |
| 34 | +| `show()` | `void` | Makes cursor and text overlays visible. | `FastOverlayWindow.show` | |
| 35 | +| `hide()` | `void` | Hides cursor and text overlays. | `FastOverlayWindow.hide` | |
| 36 | +| `dispose()` | `void` | Shuts down animation thread, releases overlay windows, and restores OS cursor. | Win32 handle cleanup | |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +### `FastGhostMouseBot` |
| 41 | + |
| 42 | +| Method | Signature | Description | Subsystem Call | |
| 43 | +|:---|:---|:---|:---| |
| 44 | +| `softPress(x, y)` | `void` | Injects low-latency virtual left mouse button down event. | `FastRobot.virtualMousePress` | |
| 45 | +| `softDrag(x, y)` | `void` | Dispatches continuous coordinate stream during active drag. | `FastRobot.virtualMouseMove` | |
| 46 | +| `softRelease(x, y)` | `void` | Injects virtual left mouse button release and resets drag state. | `FastRobot.virtualMouseRelease` | |
| 47 | +| `isDragging()` | `boolean` | Queries active drag state. | Internal boolean state | |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## 3. Platform Support |
| 52 | + |
| 53 | +| Platform | Architecture | Status | Engine / Pipeline | |
| 54 | +|:---|:---|:---|:---| |
| 55 | +| **Windows 10 / 11** | `x64` | ✅ Fully Supported | Win32 Layered Windows + DirectComposition (`FastOverlay`) | |
| 56 | +| **Windows 10 / 11** | `arm64` | 🚧 Planned | Native Windows on ARM DirectComposition pipeline | |
| 57 | +| **Linux** | `x64` | 🚧 Planned | X11 Composite / Wayland Subsurface transparent overlay | |
| 58 | +| **macOS** | `x64` / `arm64` | 🚧 Planned | CoreGraphics / Metal Overlay Window | |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## 4. Ecosystem Integration |
| 63 | + |
| 64 | +``` |
| 65 | ++-------------------------------------------------------------+ |
| 66 | +| FastGhostMouse Application | |
| 67 | ++-------------------------------------------------------------+ |
| 68 | + | |
| 69 | + +----------------------+----------------------+ |
| 70 | + | | |
| 71 | + v v |
| 72 | ++-----------------------------+ +-----------------------------+ |
| 73 | +| FastOverlay | | FastRobot | |
| 74 | +| (DirectComposition Canvas) | | (Native Input Injection) | |
| 75 | ++-----------------------------+ +-----------------------------+ |
| 76 | + | | |
| 77 | + +----------------------+----------------------+ |
| 78 | + | |
| 79 | + v |
| 80 | ++-------------------------------------------------------------+ |
| 81 | +| FastCore | |
| 82 | +| (Native Library JNI Loader) | |
| 83 | ++-------------------------------------------------------------+ |
| 84 | +``` |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +Part of the **FastJava** ecosystem. Clean architectures, zero EDT lag, maximum speed. |
0 commit comments