Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

docs: add keyboard reference with batching behavior

Data1375b1ae99e1
diff --git a/docs/reference/keyboard.md b/docs/reference/keyboard.md
new file mode 100644
index 00000000..b9af83c9
--- /dev/null
+++ b/docs/reference/keyboard.md
@@ -0,0 +1,59 @@
+# Keyboard
+
+Low-level keyboard input commands for typing text and dispatching key events.
+
+## keyboard type
+
+Type text by dispatching individual key events (keyDown/keyUp) for each character. This triggers keyboard event listeners that some applications depend on.
+
+```bash
+pinchtab keyboard type "hello world"
+```
+
+**Performance note:** For strings longer than 20 characters, PinchTab uses a hybrid approach to avoid CDP timeouts: the first and last 5 characters are typed with real key events, while the middle portion uses `Input.insertText`. This provides realistic keystroke simulation at boundaries while keeping performance acceptable for long strings.
+
+## keyboard inserttext
+
+Insert text directly without dispatching key events. Equivalent to pasting text — faster but won't trigger keydown/keypress/keyup listeners.
+
+```bash
+pinchtab keyboard inserttext "[email protected]"
+```
+
+Use `inserttext` when:
+- You need maximum speed
+- The target doesn't rely on key event listeners
+- You're filling forms programmatically
+
+Use `type` when:
+- The application validates input on keypress
+- You need to trigger autocomplete or live search
+- You're simulating realistic user input
+
+## keydown / keyup
+
+Hold or release individual keys. Useful for modifier keys (Shift, Ctrl, Alt) or testing key-hold behaviors.
+
+```bash
+pinchtab keydown Shift
+pinchtab keyboard type "abc" # Types "ABC" (shift held)
+pinchtab keyup Shift
+```
+
+## API Equivalent
+
+```bash
+curl -X POST http://localhost:9867/action \
+ -H "Content-Type: application/json" \
+ -d '{"kind":"keyboard-type","text":"hello world"}'
+
+curl -X POST http://localhost:9867/action \
+ -H "Content-Type: application/json" \
+ -d '{"kind":"keyboard-inserttext","text":"hello world"}'
+```
+
+## Related Pages
+
+- [Type](./type.md) — Type into a specific element by selector/ref
+- [Fill](./fill.md) — Set input value directly
+- [Press](./press.md) — Press a single key
diff --git a/docs/reference/type.md b/docs/reference/type.md
index 86c20711..4dd87708 100644
--- a/docs/reference/type.md
+++ b/docs/reference/type.md
@@ -21,8 +21,10 @@ Notes:
- use `fill` when you want to set the value more directly
- the top-level CLI accepts unified selector forms such as `e8`, `#name`, `xpath://input`, or `text:Name`
+- for typing without a target element (into whatever is focused), use `keyboard type`
## Related Pages
-- [Fill](./fill.md)
+- [Fill](./fill.md) — Set input value directly
+- [Keyboard](./keyboard.md) — Low-level keyboard input (type at focused element)
- [Snapshot](./snapshot.md)