Skip to content

Commit 0fc46db

Browse files
author
FastJava Team
committed
docs: Add Input/Output architecture philosophy and FastInput module to MAP.md
1 parent 369ceb9 commit 0fc46db

1 file changed

Lines changed: 44 additions & 6 deletions

File tree

MAP.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FastJava is **minimal, deterministic, zero-bullshit** — built for bots, automa
2222
## 📦 Module Overview (62)
2323

2424
### Core (Agent I/O)
25-
FastRobot, FastScreen, FastInputHook, FastVision, FastHotkey, FastGamepad, FastHumanInput
25+
FastRobot, FastScreen, FastInput, FastInputHook, FastVision, FastHotkey, FastGamepad, FastHumanInput
2626

2727
### System & Window
2828
FastWindow, FastProcess, FastTheme, FastOverlay, FastWindowEvents, FastSystemMetrics, FastDWM, FastFileWatch, FastProcessWatch
@@ -58,11 +58,12 @@ FastJava, FastCore, FastPlugin
5858
|--------|-------------|
5959
| **FastRobot** | Java's Robot class is too slow for game bots. FastRobot uses native SendInput with batch processing for 1000+ events in one call - sub-millisecond reaction times. |
6060
| **FastScreen** | Screenshots with Java.awt take 50-100ms. FastScreen uses DXGI Desktop Duplication for 500-2000 FPS zero-copy capture - essential for vision bots. |
61-
| **FastInputHook** | Java processes events only after the JVM queue. FastInputHook uses SetWindowsHookEx for low-level events BEFORE Java - for instant hotkeys and triggers. |
61+
| **FastInput** | Read mouse, keyboard, and HID input via RawInput (non-hooking, non-invasive) for high-frequency input reading. |
62+
| **FastInputHook** | Global hook counterpart to FastInput — captures ALL low-level events (SetWindowsHookEx) before they reach any application. |
6263
| **FastVision** | Java2D is too slow for object detection. FastVision uses GPU compute shaders for <10ms template matching and feature extraction. |
63-
| **FastHotkey** | Global hotkeys without keylogging suspicion. Only registered combos are intercepted - safe for productive bots. |
64+
| **FastHotkey** | Safe, filtered version — only registered combinations are intercepted, without the invasiveness of global hooks. |
6465
| **FastGamepad** | No native controller support in Java. FastGamepad reads XInput/DirectInput for racing/fighting game bots. |
65-
| **FastHumanInput** | Unifies all input sources (keyboard, mouse, touch, stylus, gamepad) into a single stream. |
66+
| **FastHumanInput** | Unifies all input sources into a single event stream optimized for AI agents and automation pipelines. |
6667

6768
### System & Window
6869

@@ -181,7 +182,44 @@ FastJava, FastCore, FastPlugin
181182

182183
---
183184

184-
## 🧩 Architecture
185+
## 🎯 Architecture Philosophy: Input vs Output
186+
187+
FastJava separates modules by **direction**, not by device type:
188+
189+
| Direction | Meaning | Modules |
190+
|-----------|---------|---------|
191+
| **Input** | "I read what the user does" | FastInput, FastScreen, FastTouch, FastStylus, FastGamepad |
192+
| **Output** | "I control the PC" | FastRobot |
193+
| **Both** | Bidirectional devices | FastTouch, FastStylus, FastGamepad |
194+
195+
### Why mouse + keyboard stay together
196+
197+
Windows **RawInput API** delivers mouse and keyboard in the **same callback loop**. Splitting them would require:
198+
- Two JNI bridges
199+
- Two message loops
200+
- Two event queues
201+
- Double the maintenance
202+
203+
**Violation of:** `minimal, deterministic, zero-bullshit`
204+
205+
### Modules by technology, not device
206+
207+
| Module | Technology | Why separate? |
208+
|--------|------------|---------------|
209+
| FastInput | RawInput, Hooks | Reads user input |
210+
| FastRobot | SendInput, DirectInput | Sends output to PC |
211+
| FastTouch | Windows Pointer API | Touch injection + multi-point |
212+
| FastStylus | Pointer API (Pen) | Pressure, tilt, eraser |
213+
| FastGamepad | XInput/DirectInput | Controller, rumble |
214+
| FastScreen | DXGI Desktop Duplication | Zero-copy capture |
215+
216+
Only **fundamentally different technologies** get separate modules.
217+
218+
---
219+
220+
## 🧩 Architecture Layers
221+
222+
> Architecture Layers list modules only. Detailed descriptions are in [Module Details](#-module-details).
185223
186224
```
187225
┌─────────────────────────────────────────────────────────────────────────────┐
@@ -191,7 +229,7 @@ FastJava, FastCore, FastPlugin
191229
192230
┌─────────────────────────────────────────────────────────────────────────────┐
193231
│ HIGH-LEVEL AUTOMATION LAYER │
194-
│ FastRobot • FastInputHook • FastHotkey • FastGamepad • FastHumanInput
232+
│ FastRobot • FastInput • FastInputHook • FastHotkey • FastGamepad • FastHumanInput |
195233
│ FastScreen • FastVision • FastOCR • FastAudioCapture │
196234
└─────────────────────────────────────────────────────────────────────────────┘
197235

0 commit comments

Comments
 (0)