No description
  • Rust 78.5%
  • JavaScript 6.6%
  • TypeScript 4%
  • HTML 4%
  • Shell 2%
  • Other 4.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 08cd058df8
iOS: swipe typing for English and Spanish (Experiment, off by default) (#2106)
* iOS keyboard: a swipe-typing decoder for English and Spanish

SwipeDecoder reads a finger's path across the letter keys as a word, for
the Swipe typing experiment (wired into the keys in the next commit). It
is a shape-matching decoder after SHARK2, written for Hex, on the existing
Google Books typing models (en.hextm, es.hextm) and nothing else:

- the path is resampled to 32 points in key pitches;
- words come straight from the memory-mapped model: its sorted word list
  gives each start letter as one range (TypingDecoderModel.withCodes reads
  codes in place), kept when their last key is near the lift, every key is
  near the path and their ideal path is about as long. No index is built
  or kept between swipes, so the decoder adds no memory at rest;
- each is scored on location (point by point, then DTW for the best 80,
  after a cheap prefilter caps loose swipes at 1,500 words), shape, and a
  heavy-tailed start and end key cost, and weighed with the model's
  word-pair frequency after the word before (stupid backoff, as Spatial
  autocorrect's).

English contractions are read as extra words in three frequency tiers:
Google Books splits "don't" into "do n't", so the model ranks it like
"tom" and lacks "I'm" entirely. Slurs are never read and swear words only
when allowed (TypingDecoder.NeverSuggest from OffensiveWords).

Weights were tuned on synthetic swipes (clean, neat, typical, sloppy
fingers) of the autocorrect benchmark's held-out dev sentences, through
Hex's real 390 pt key geometry; the test sentences were used once, at
the end. Held-out test, typical fingers: English top-1 94.9% / top-3
99.1% (top-5k words 95.9%), Spanish 91.1% / 98.4% (93.7%); decode median
0.78 ms, p99 2.6-2.8 ms, max 4.2 ms on an M5 Max.

Verified: SwipeDecoderTests (new file: the decoder's own fixtures are
paths) pass on an iPhone 13 simulator, iOS 27.2: clean and offset swipes,
Spanish accents and ñ, contractions, context, slurs and swear words.

* iOS keyboard: Swipe typing, an experiment off by default (English and Spanish)

Two TestFlight testers asked for glide typing. Settings › Experiments ›
Swipe typing (off by default, App Group experiments.swipeTyping, launch
argument --experiment-swipe) lets a finger slide from a letter through a
word's letters, as Apple's QuickPath and Gboard do, on the English and
Spanish layouts only; every other layout keeps a drag as a slide to
another key, and VoiceOver keeps its own typing.

- SwipeTyping (new file) owns the gesture: a touch that goes down on a
  letter and travels more than a key's pitch (width plus gap) becomes a
  swipe; its key no longer types (FullKeyboardEngine.beginSwipe), a light
  trail (a CAShapeLayer with the last 0.45 s of the path, no bitmap)
  follows the finger, and the strip shows the word the path reads as so
  far, decoded off the main thread at most every 70 ms. Lifting decodes
  on the main thread and types the word.
- FullKeyboardEngine's swipe section types it after a space unless the
  text before ends in a space, a line break or opening punctuation;
  shift capitalises its first letter (caps lock all of it), the added
  space can start a sentence, and a name the dictionary only knows
  capitalised is capitalised. The strip then offers the next three
  readings (KeyboardSuggestion.Kind.swiped, likeliest in the centre);
  tapping one replaces the word. Until anything else edits the text,
  delete takes the whole word back with its space and space never
  autocorrects it (small guards in deleteBackward and typeSpace; insert,
  textDidChange, the trackpad and a new field clear it). A second finger
  ends a swipe first, so its word goes before that key's letter.
- Readings pass AutocorrectEngine.mayOffer: no slurs, swear words only
  with Suggest swear words on. The decoder also reads Hex's English
  contractions and your own words (AutocorrectEngine.ownWords: Contacts
  names and other UILexicon terms, one-word text replacements, kept
  words), rebuilt when ownWordsRevision changes.
- Typing logs record swipe_start and swipe_end (points, decode ms,
  readings) beside the touch moves, to fit the decoder to real fingers.
- Taps, accents, delete repeat and delete's word slide, the space bar's
  trackpad, 123 and the Hex key are unchanged: no swipe starts on them,
  and none while an accent menu is open.

The Experiments row's two new strings have zh-Hans translations
(滑行键入, Apple's name for QuickPath). README documents the experiment.

Verified on an iPhone 13 simulator (iOS 27.2): the full HEXMobileTests
suite, 322 tests, 0 failures (1 skipped, as before), including 12 new
FullKeyboardEngineTests cases for spacing, capitals, caps lock, delete,
the readings, space, taps/slides/accents, delete and the space bar,
layout gating, Spanish, a second finger, cancel, and offensive words.

* iOS keyboard: swipe_end logs decode time to the microsecond; the trail stops off screen

- Record typing logs' swipe_end line wrote the decode time rounded to whole
  milliseconds, which reads 0 or 1 for nearly every swipe (decode is about
  a millisecond); it now uses TypingLogValue.ms (three decimals), as the
  logs' other timings do.
- SwipeTrailView's display link holds the view: if the keyboard's view left
  its window mid-swipe, the link would keep redrawing an unseen trail. It
  now stops (and the trail clears) when the view leaves its window, and
  never starts without one (tests drive the plane off screen).

Verified: built for the iPhone 13 simulator (iOS 27.2); in a live keyboard
in Messages, swipe_end lines carry fractional ms and the trail fades on
lift as before.

* iOS keyboard: Swipe typing after the multilingual keyboard and #2100

Rebased onto the multilingual keyboard (#2104), dictation styles (#2103)
and #2100's strip and space changes:

- A swipe's lift now counts as a key coming up for #2100's strip guard
  (FullKeyboardEngine.lastKeyTouchAt): a quick tap on the strip's lower
  half right after a swipe types the row-1 key below it, as after any key,
  instead of picking one of the swipe's readings. The swipe never reached
  touchEnded, so the guard only saw its touch-down.
- The trackpad's start (now startTrackpad, for both a slide and #2100's
  hold) clears the swiped word, as the slide did before.
- Swipe typing follows the language the space bar switches to: syncLanguage
  (which #2104 calls on every switch) also syncs it, so it is on only while
  the current language is English or Spanish, with that language's model.
  A quick slide along the space bar stays a language swipe: swipes start
  only on letter keys.

Spacing composes with #2100: a swiped word is typed with didEdit, which
clears the swallowed-suggestion-space state, and adds no trailing space,
so a space typed after it is always one space.

Verified: the full HEXMobileTests suite on an iPhone 13 simulator (iOS
27.2), 348 tests, 0 failures (1 skipped, as on dev), including the new
testSwipeTypingFollowsALiveLanguageSwitch (English, German, Spanish) and
a space-bar language swipe with Swipe typing on.

* iOS keyboard: Swipe typing reads across the iPhone Duo's split keyboard

#2105 splits the keyboard on the Duo unfolded upright: two halves, G and V
on both, and nothing in the middle. TypingDecoder.Keys already places every
key as on the unsplit keyboard (KeyboardLayout.unsplitX), so the decoder's
letter centres were right, but a swipe's points were read where they were
drawn, so the right half's strokes landed a gap away from their keys.

Swipe points are now read where KeyboardLayout.joinedForSwipe puts them:
the right half pushed against the left, as unsplitX does, and the middle
between the halves squeezed to one key's gap, so a stroke across it stays
one continuous stroke (unsplitX alone would jump it back by the gap), as
Gboard joins the halves. Either half's G and V is the one letter. On the
split, a touch becomes a swipe after the split's own key pitch, 57 pt
(KeyboardLayout.swipePitch); the trail still follows the finger where it is.

Benchmark (synthetic swipes of the held-out dev sentences on Apple's split
geometry at 801 pt, G and V taken on the side nearer the neighbouring
letter): English top-1 95.4% / top-3 99.3% with typical fingers (97.9%
clean), Spanish 90.0% / 97.9% (93.9% clean), as on the phone layout.

Verified: the full HEXMobileTests suite on an iPhone 13 simulator (iOS
27.2), 356 tests, 0 failures (1 skipped, as on dev), including the new
testASwipeReadsAcrossTheSplitKeyboardsMiddle ("hello", "the", "keyboard"
across the middle; "give" from the right half's G). AXe can't touch the
Duo's inner screen (#2105), so the split was not swiped live.
2026-11-20 22:30:53 +00:00
.cargo Add KB-Whisper Medium for Swedish (#1991) (#1992) 2026-11-19 05:44:56 -05:00
.cloudflare/cache ci(aur): a dispatchable check that the AUR accepts the deploy key 2026-10-23 14:41:55 -04:00
.config feat(onboarding): the first run is one story, from a bad conversation to your first words (#1501) 2026-11-09 17:29:51 -08:00
.github Set up Hex Mobile internal TestFlight releases (#1997) 2026-11-19 11:48:49 -05:00
android Bump Hex Android to 0.1.1 (build 2) for internal testing (#2082) 2026-11-20 18:09:21 +00:00
app Keep the old Sparkle key so 2.3.1 and Swift Hex can update into the new Hex (t1217) (#1092) 2026-11-02 21:44:19 -08:00
assets Show Jay's photo in onboarding (#1630) 2026-11-10 13:41:20 -08:00
crates annotate: record the screen under the pointer on wayland (labs), list hex annotate without a shortcuts portal (#2094) 2026-11-20 15:58:16 -05:00
design Captures: the Scrawl capsule and ink overlay on Rune 2026-10-26 10:48:55 -07:00
docs windows, linux: keep a dictation press across a microphone reopen (#2098) 2026-11-20 16:58:08 -05:00
ios iOS: swipe typing for English and Spanish (Experiment, off by default) (#2106) 2026-11-20 22:30:53 +00:00
macos/HexMicrophoneDriver feat(macos): the app is anomaly.hex, a new app to macOS, from the first Anomaly-signed release 2026-10-23 14:57:13 -04:00
native macOS: close the Screen Recording guide once Hex reads the grant (#2086) 2026-11-20 14:50:03 -05:00
nix fix: drop parakeet's padding mel frame before the encoder (#2072) (#2076) 2026-11-20 13:01:29 -05:00
packaging windows: sign the setup engine so smart app control can run setup (#1987) 2026-11-19 02:38:03 -05:00
perf perf: listening bench waits for the listener before measuring rest (#1615) 2026-11-09 16:19:11 -06:00
prototypes/app-shell Rename voice-control to hex everywhere, without migrations (#293) 2026-10-28 13:08:44 -04:00
release-notes feat: add local transcription service and resilient capture 2026-07-21 14:22:12 -04:00
resources linux: recolor the tray mark with the panel's text color (#1691) 2026-11-11 10:46:08 -05:00
scripts iOS: split DictationController so dev passes the size check (#2066) 2026-11-20 11:42:45 -05:00
sdk add fluid speech pro to the speech model catalog (#2007) 2026-11-19 15:19:06 -05:00
site site: cover Hex for Android in the privacy policy (#2073) 2026-11-20 17:26:50 +00:00
skills/hex-personal-commands docs: rewrite README minimal, shorten CONTRIBUTING 2026-11-01 12:44:35 -05:00
src windows, linux: keep a dictation press across a microphone reopen (#2098) 2026-11-20 16:58:08 -05:00
tests annotate: record the screen under the pointer on wayland (labs), list hex annotate without a shortcuts portal (#2094) 2026-11-20 15:58:16 -05:00
.gitignore iOS: clean up what I say with an on-device tagger (experiment) (#2023) 2026-11-20 01:29:41 +00:00
.hivemind.toml feat(land): add declarative .hivemind.toml land queue + Hex.app swap (t811) (#387) 2026-10-29 09:52:47 -07:00
.markdownlint-cli2.jsonc feat: unify desktop modes and platform runtime 2026-07-23 17:33:22 -04:00
AGENTS.md feat(history): find dictations and captures together on Mac (#1932) 2026-11-19 19:52:09 -08:00
build.rs feat(onboarding): the first run is one story, from a bad conversation to your first words (#1501) 2026-11-09 17:29:51 -08:00
Cargo.lock fix: drop parakeet's padding mel frame before the encoder (#2072) (#2076) 2026-11-20 13:01:29 -05:00
Cargo.toml fix: drop parakeet's padding mel frame before the encoder (#2072) (#2076) 2026-11-20 13:01:29 -05:00
clippy.toml Add agent marker and drop internal references (#702) 2026-10-31 18:30:32 -07:00
CONTRIBUTING.md docs: rewrite README minimal, shorten CONTRIBUTING 2026-11-01 12:44:35 -05:00
flake.lock feat(linux): add wlroots Wayland support and Nix packaging (#36) 2026-08-28 12:05:21 -04:00
flake.nix nix: build for aarch64-linux (#1057) 2026-11-02 14:11:35 -05:00
LICENSE feat: unify desktop modes and platform runtime 2026-07-23 17:33:22 -04:00
README.md Add KB-Whisper Medium for Swedish (#1991) (#1992) 2026-11-19 05:44:56 -05:00
ROADMAP.md add pause from menu bar lab (#1654) 2026-11-10 17:51:36 -05:00
SECURITY.md Rename voice-control to hex everywhere, without migrations (#293) 2026-10-28 13:08:44 -04:00
strobe.json perf: listening bench waits for the listener before measuring rest (#1615) 2026-11-09 16:19:11 -06:00
THIRD_PARTY_NOTICES.md add fluid speech pro to the speech model catalog (#2007) 2026-11-19 15:19:06 -05:00

Hex

Hex is local voice dictation for Mac, Windows and Linux. Hold a key, speak, and it pastes.

How it works

  • hold the shortcut, speak, then let go
  • Hex transcribes on your device and pastes into whatever app you're in
  • the first run downloads a speech model; after that nothing leaves your machine
  • experimental features live in Labs, at the bottom of the sidebar

What it does

  • hold the shortcut to dictate, or set Shortcut mode to Tap to start and stop with a press
  • the text lands at the cursor in whatever app you're in
  • Option-Shift-V pastes the last dictation again (Ctrl-Alt-V on Windows and Linux)
  • History keeps your dictations, searchable, for 7 days by default
  • Output runs every dictation through steps you choose (word replacements, built-in cleanups, your own scripts, an optional OpenCode rewrite), with different steps per app or website
  • Vocabulary is one list of names Hex should know; Whisper and Qwen3-ASR read it while transcribing, Parakeet models read it with Labs › Vocabulary help on, and the OpenCode rewrite uses it
  • Annotate records the screen while you draw and talk, on macOS, Linux and Windows (GNOME Wayland needs Labs › Annotate on GNOME)
  • an authenticated local API and the TypeScript SDK transcribe with the same model, for your own tools
  • Meetings is a macOS lab that records a call and writes the transcript

Output and History:

Hex output: the steps every dictation runs, a Try box, and different steps per app Hex history: past dictations, a search field, and one entry's raw transcript, app, processing and model

Speech models

Hex downloads one model the first time it runs and transcribes with it on your machine from then on. On an English system that's Parakeet Unified English: it writes while you talk, so the text is ready when you let go. Other languages start with the model recommended for them. That model also serves meetings and hex transcribe.

Settings' picker offers more, among others:

  • Parakeet v3: 25 European languages, and it hears which one you speak
  • Cohere Transcribe: the fewest wrong words, in 14 languages; a big download
  • Whisper large-v3-turbo: almost any language, and it reads your vocabulary
  • Qwen3-ASR 0.6B: Chinese and 29 more, and it reads your vocabulary
  • SenseVoice Small: Chinese, Japanese, Korean and English; a small download
  • Nemotron 3.5 ASR: writes while you talk, in 27 languages
  • Granite Speech 5.0: IBM's model, seven languages, with punctuation
  • one-language models: ivrit.ai Whisper for Hebrew, GigaAM v3 for Russian, NB-Whisper for Norwegian, KB-Whisper for Swedish, QwenCleo-ASR for Egyptian Arabic
  • more English models: Parakeet v2 and Underdog Bark 3.0

Add a GGUF model of your own with "Add model file…" in the picker; see your own speech models.

Downloads

Stable is the current release. Dev is the newest build of dev and updates itself from the dev channel.

Platform Stable Dev
macOS (Apple silicon) DMG DMG
Windows x64 Installer Installer
Windows ARM64 Installer Installer
Linux x86_64 Executable Executable
Linux x86_64 (Debian, Ubuntu) .deb .deb
Linux x86_64 (Fedora, openSUSE) .rpm .rpm
Linux ARM64 Executable Executable
Linux ARM64 (Debian, Ubuntu) .deb .deb
Linux ARM64 (Fedora, openSUSE) .rpm .rpm

Or install with:

  • Homebrew: brew install --cask anomalyco/tap/hex
  • AUR: yay -S hex-bin
  • install script (Linux): curl -fsSL https://anoma.ly/hex/install-linux.sh | sh
  • Nix (Linux): nix profile add github:anomalyco/hex

Command line

hex transcribe meeting.m4a prints a recording's transcript, whether or not the app is running. It reads WAV, AIFF, CAF, FLAC, MP3, Ogg, WebM, and MP4/M4A/MOV, including a video's soundtrack. The same hex controls the running app (hex status, hex dictation, hex settings); see docs/cli.md.

On macOS the CLI is inside the app. Homebrew links it for you; otherwise link it somewhere on your PATH that you own:

ln -s /Applications/Hex.app/Contents/MacOS/hex ~/.local/bin/hex

Linux and Windows installs put hex on your PATH.

More docs are in docs/.

Contributing

We don't take pull requests. Open an issue describing the bug or idea, and our agents usually turn it around fast.

MIT licensed.