skey-engine
Stateless Vietnamese input method engine written in Rust — used by skey, a fcitx5 Vietnamese input method addon.
Why
skey only needs a stateless input → output transform for Vietnamese text
processing. Most existing engines carry unnecessary state-machine complexity.
skey-engine provides the same functionality in ~700 lines of straightforward Rust,
with a simple Letter-based accumulator model.
Design
- Stateless —
input string → output string, no internal mutable state - Unikey-compatible transforms —
dd→đ,aa→â,aw→ă,ow→ơ,uw→ư,vaya→vây,toiws→tới, tone replacement, and more - String-based
is_valid()— CVC validation works on the composed string directly, not tied to engine state - 4 input methods — Telex, VNI, VIQR, and combined Telex+VNI
- Embedded dictionary — optional dictionary mode for auto-restore: validates the composed output against a ~7.9k-word Vietnamese list compiled into the binary (no runtime file loading), extensible with user words
- Thin FFI — 10 C functions covering lifecycle, config, transform, and validation
API
// Lifecycle
SkeyEngine *; // 0=Telex, 1=VNI, 2=VIQR, 3=TeipVni
void ;
// Configuration
void ;
void ; // 0=traditional, 1=modern
void ; // standalone w→ư
void ; // reserved
void ; // reserved
void ; // auto-restore checks real words
void ; // user word override
// Core
char *;
int32_t ;
void ;
Build
# → target/release/libskey_engine.a
Release
Bump version and create a tag:
# 1. Edit version in Cargo.toml
# 2. Commit & tag
Pushing a v* tag triggers the release workflow
which builds libskey_engine.a, runs tests, and publishes the artifact to
GitHub Releases.