How leujasyoh/type works
Type is a Windows desktop keyboard-input simulator. The user enters text and options in the Vue UI, starts a delayed task, then focuses a target window; the Go service locks that window and injects text through keyboard, text-message, or clipboard-paste paths, reporting progress and errors back to the UI. Win32 supplies injection, clipboard, and foreground-window capabilities. The README documents additional clipboard safeguards, focus-drift protection, WebView2, and window controls. Backend details are only partially sampled; unsampled documented capabilities are shown without speculative internal wiring.
Main entry points: main.go WebView host · typing.go Typing service · win32_keyboard.go Input injector · App.vue Typing UI
Components 19
User interface
- Typing UI
frontend/src/App.vue - Task controls
frontend/src/composables/useTypingTask.ts - Theme
frontend/src/composables/useTheme.ts - Progress status
frontend/src/components/StatusBar.vue - Typed IPC
frontend/src/ipc.ts
Desktop application
- WebView host
cmd/type/main.go - Embedded page
internal/web/web.go
Typing workflow
- Typing service
internal/typing/typing.go
Windows integration
- Foreground probe
internal/win32/win32_window.go - Input injector
internal/win32/win32_keyboard.go - Clipboard handling
internal/win32/win32_clipboard.go - Single-instance guard
internal/win32/win32_instance.go - WebView2 preflight
internal/win32/win32_webview2.go - Native prompts
internal/win32/win32_msgbox.go - Window controls
internal/win32/win32_window.go
Other components
- User
- WebView2
- Target window
- Windows clipboard
Connections 23
- User → Typing UI: enters text
- Typing UI → Task controls: starts or cancels
- Typing UI → Theme: toggles theme
- Task controls → Typed IPC: sends commands
- Typed IPC → WebView host: calls bindings
- WebView host → Typing service: dispatches tasks
- Typing service → WebView host: publishes status
- Typed IPC → WebView host: polls status
- Task controls → Progress status: renders progress
- WebView host → Embedded page: loads page
- WebView host → WebView2: creates window
- WebView host → Single-instance guard: guards startup
- WebView host → WebView2 preflight: checks runtime
- WebView2 preflight → Native prompts: prompts on failure
- WebView host → Window controls: sets window properties
- Typing service → Foreground probe: samples target
- Foreground probe → Target window: checks foreground
- Typing service → Input injector: injects text
- Input injector → Target window: sends input
- Typing service → Clipboard handling: snapshots and restores
- Clipboard handling → Windows clipboard: reads and writes formats
- Input injector → Windows clipboard: sets paste shortcut
- Input injector → Target window: sends paste