Dokey: A Vietnamese Input Method That Rebuilds the Whole Word on Every Keystroke
Vietnamese is typed on standard keyboards through input methods such as Telex and VNI, in which ordinary letter or digit keys add diacritics and tones to the word being typed. Common input methods often produce jumbled or lost letters in browsers and Electron applications, and they add tones to English words. Dokey is a new input method for macOS and Windows, written from scratch, that addresses these problems with three design decisions: (1) the engine keeps only the raw keys of the current word and recomputes the displayed word from them with a pure function on every keystroke; (2) a diacritic or tone key is applied only if the result is still a prefix of a valid Vietnamese syllable, otherwise the keys are shown as typed; and (3) the platform layer applies each correction as a single minimal edit, choosing a delivery strategy per application class. The engine is a dependency-free C++17 library of about 1,300 lines with a C API, used by a Swift/AppKit app on macOS and a Win32 app on Windows. We report the design, the platform layers and an evaluation: all 20,635 automated test cases pass, including a round trip over 3,964 syllables with every tone and a regression corpus of 1,171 English and developer words and 30 Vietnamese sentences; the engine takes a median of 0.7–0.8 µs per key on a 2014 desktop CPU; and 11.9% of keys in the corpus need a correction, with 1.39 deletions per correction on average. We also list what has not been tested, notably real Windows machines and several browsers. The author's company is a member of Anthropic's Claude Startups program and received Claude Team access and API credits through it. Claude (Anthropic) assisted with code, debugging and the drafting of this paper. In the author's own experience it made project work roughly ten times faster: problems that once ended with a long sip of water and a longer stare at the screen now usually end with a working fix. The author reviewed all content and is solely responsible for it; Anthropic did not sponsor, review or endorse this work.
Authors
- Do Huy Toan
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-02
- DOI
- https://doi.org/10.5281/zenodo.23888334
- Primary Topic
- Usability and User Interface Design
- Type
- article
- Field-Weighted Citation Impact
- 0.00