A Windows background utility that provides system-wide inline text autocompletion. It tracks what you type in any application, asks an LLM for a continuation, and shows the suggestion in a floating window near the caret. Press Tab to accept the next chunk, Esc to dismiss.
- System-wide capture — low-level keyboard/mouse hooks plus UI Automation events track the text of the focused editable control in any app.
- Two-tier input tracking —
UIAInputreads real text from UIAText/Valuepatterns when available and falls back toHeuristicsInput(keystroke reconstruction) otherwise. Password fields and non-editable elements are ignored. - Debounced LLM requests — a background worker (
SuggestionsScheduler) waits for a typing idle gap (~300 ms) and only serves the response matching the latest input version, so stale suggestions are dropped. - Anchor-based prompting — the request sends the full typed
contextplus a trailing 3-wordanchor; the model must continue the anchor by 2–3 words. The system prompt is embedded as an RC resource (SystemPrompt.txt). - Prefix subtraction —
PrefixSubtractSuggestionProcessorstrips the part of the response that repeats what is already typed (case-insensitive) and splits the remainder into insertion tokens that preserve spacing, soTabinserts one word at a time. - Injected-input awareness — accepted text is sent via
SendInputand marked as expected, so the tool does not treat its own output as user typing. - Offline mode — run with the
DISABLE_LLMargument to use a stub LLM service.
- C++20, MSVC v143, x64, Unicode, Visual Studio solution (
AutoFiller.sln) - Win32 API:
SetWindowsHookEx(WH_KEYBOARD_LL / WH_MOUSE_LL),SetWinEventHook,SendInput, layered window for the suggestion popup - UI Automation (
uiautomation.h, WRLComPtr) for focused-element text and change events - WinHTTP for HTTPS calls to the OpenAI Responses API (
/v1/responses) - nlohmann/json (NuGet) for request payload building
- GoogleTest (NuGet) for unit tests
| Project | Type | Contents |
|---|---|---|
AutoFiller |
Console app | Entry point, hooks, buffer, input routing, LLM client, scheduler, suggestion window |
AutoFiller.Core |
Static library | Platform-independent suggestion post-processing (SuggestionProcessingProvider) |
AutoFillerTests |
Test app | GoogleTest suite for suggestion processing |
# Restore NuGet packages and build from Visual Studio, or:
msbuild AutoFiller.sln /p:Configuration=Debug /p:Platform=x64
# Configure the model access
$env:OPENAI_API_KEY = "sk-..."
$env:OPENAI_MODEL = "gpt-5.4-nano" # optional
x64\Debug\AutoFiller.exe
# or without any LLM calls:
x64\Debug\AutoFiller.exe DISABLE_LLMThe app runs in a console window and logs buffer state, LLM requests/responses and errors to stdout. Close the console or press Ctrl+C to stop.