mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 19:07:17 +01:00
Drives a Flutter web build in a persistent headless chromium (systemd-run unit, own profile, CDP port) through the semantics tree: tree, tap by label, text, key, scroll, wait, shot, console. Never touches the live display; attaches only to HeadlessChrome. The MCP server wraps the same Driver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZ4sULGfyav7EEwQ6vhbfg
23 lines
914 B
Python
23 lines
914 B
Python
"""Named keys the ``key`` verb can press."""
|
|
|
|
from __future__ import annotations
|
|
|
|
# name -> (key, code, windowsVirtualKeyCode, text). Text makes chromium emit
|
|
# the char event Flutter's text input listens for (Enter submits a field).
|
|
KEYS: dict[str, tuple[str, str, int, str]] = {
|
|
"Enter": ("Enter", "Enter", 13, "\r"),
|
|
"Escape": ("Escape", "Escape", 27, ""),
|
|
"Tab": ("Tab", "Tab", 9, ""),
|
|
"Backspace": ("Backspace", "Backspace", 8, ""),
|
|
"Delete": ("Delete", "Delete", 46, ""),
|
|
"Space": (" ", "Space", 32, " "),
|
|
"ArrowUp": ("ArrowUp", "ArrowUp", 38, ""),
|
|
"ArrowDown": ("ArrowDown", "ArrowDown", 40, ""),
|
|
"ArrowLeft": ("ArrowLeft", "ArrowLeft", 37, ""),
|
|
"ArrowRight": ("ArrowRight", "ArrowRight", 39, ""),
|
|
"Home": ("Home", "Home", 36, ""),
|
|
"End": ("End", "End", 35, ""),
|
|
"PageUp": ("PageUp", "PageUp", 33, ""),
|
|
"PageDown": ("PageDown", "PageDown", 34, ""),
|
|
}
|