Skip to content

tribixbite/CleverKeys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,764 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CleverKeys


API Kotlin ONNX Runtime Material 3




🗺️ Project Overview

CleverKeys is a feature-rich open-source keyboard for Android. Neural swipe typing with autocorrect, multi-language hot-swap with per-language dictionaries, unlimited clipboard with pinning/todos/tags/regex search/inline editing, offline GIF packs, 208 customizable short-swipe actions, TrackPoint cursor control, 35+ themes with DIY creator — all running 100% on-device with zero internet permissions.

What Makes CleverKeys Unique

Open-Source Gesture Keyboard Comparison

Feature CleverKeys HeliBoard FUTO FlorisBoard AnySoftKeyboard
Gesture Typing in Termux ⚠️ Corrupted⁴ ❌ Broken ⚠️ Disabled ⚠️ Experimental
Gesture/Swipe Typing ✅ Stable ✅ Stable ⚠️ Alpha ⚠️ Disabled⁵ ⚠️ Experimental
Multi-Language Swipe ✅ 11 languages ⚠️ Single ⚠️ English only
Gesture Engine Open Source ❌¹ ✅²
ML Training Code Public N/A ✅⁶ N/A³ N/A³
Model Size 13MB Proprietary 62MB N/A N/A
APK Size ~52MB ~45MB ~200MB ~15MB ~25MB
Clipboard History ✅ Unlimited ⚠️ 10min default⁷ ✅ 25 items ✅ 20-100 items ❌ 15s hint only
Short-Swipe Actions ✅ 208 gestures ⚠️ Limited ⚠️ Limited ⚠️ Limited
Per-Key Customization ✅ 204+ commands
Custom Layouts ✅ XML (8 sublabels) ✅ JSON ✅ YAML ⚠️ JSON (no editor) ⚠️ Addon packs only
DIY Theme Creator ❌ (16 built-in) ✅ Snygg v2
Word Suggestions ❌ (v0.6 planned)
No Internet Access
License GPL-3.0 GPL-3.0 Source-First² Apache-2.0 Apache-2.0
Footnotes & Sources

¹ HeliBoard requires Google's proprietary libjni_latinimegoogle.so library for gesture typing (source)

² FUTO uses "Source First License 1.1" — source-available but restricts commercial use (source)

³ FlorisBoard and AnySoftKeyboard use algorithmic approaches (corner matching, template matching) — no ML training involved

⁴ HeliBoard has a known bug where swipe typing in Termux produces duplicated/corrupted output

⁵ FlorisBoard glide typing is disabled by default and labeled "alpha quality" — must be enabled manually in advanced settings

⁶ FUTO swipe training dataset is public on HuggingFace with training code in their repo

⁷ HeliBoard clipboard retention defaults to 10 minutes but is configurable; items are not persisted across restarts by default

⁸ Short-swipe actions: 8 directions × 26 keys = 208 one-touch gestures for navigation (arrows, home/end), editing (select all, undo, cut/copy/paste), function keys (F1-F12), and more — no long-press menus needed

⁹ Multi-language swipe typing: CleverKeys uses the same neural network model for all languages — dictionaries provide word candidates, not language-specific models. 6 languages bundled (en, es, fr, pt, it, de), 5 downloadable (nl, id, ms, tl, sw). Primary + secondary language support with automatic best-match selection.

Why CleverKeys?

Most keyboard apps do one thing well. CleverKeys does many things well:

  • Swipe + autocorrect + multi-language — a custom transformer neural network evaluates multiple language dictionaries simultaneously per swipe, with contraction-aware autocorrect
  • Clipboard as a productivity tool — not just history, but pinning, todos with status tracking, tags, inline editing, regex search, and media support (images/videos/PDFs)
  • Deep customization — 208 short-swipe actions, Android intent launching, custom text macros, per-key gesture mapping, XML layout authoring
  • Power user essentials — TrackPoint cursor, selection-delete, backspace undo, terminal key support, offline GIF packs
  • Auditable ML — model architecture, training code, and datasets all public at CleverKeys-ML

📱 Works Everywhere — Including Termux

CleverKeys is the only open-source keyboard with reliable swipe typing in Termux. Other keyboards either disable gestures in terminals (FlorisBoard), produce corrupted output (HeliBoard), or don't work (FUTO). Commercial keyboards like Gboard and SwiftKey also disable swipe in Termux.

📲 Install Options

F-Droid Obtainium GitHub

*Recommended — Obtainium pulls directly from GitHub releases, avoiding F-Droid's typical 24-48 hour update delay.

🎨 Extensive Theme Engine

CleverKeys features one of the most powerful keyboard theme engines available:

Built-in Themes (18+)

  • CleverKeys Dark — Deep purple with silver accents (default)
  • CleverKeys Light — Silver keys with purple accents
  • Neon Cyan/Magenta — Vibrant cyberpunk aesthetic
  • ePaper / ePaper Black — High contrast e-ink styles
  • Jungle — Tropical teal theme
  • Everforest Light — Soft green nature theme
  • Monet (Auto) — Material You dynamic colors
  • Dark / Light / Black / Alt Black — Classic options
  • And many more...

DIY Theme Creator

Build your own themes on-the-fly with full control over:

  • Key Colors — Default, Activated, Locked, Modifier, Special
  • Label Colors — Primary, Sub-label, Secondary labels
  • Border Colors — Full border customization
  • Trail Effects — Swipe trail color and style

✨ Features

🧠 Neural Swipe & Autocorrect

  • Custom transformer model (encoder-decoder, 13MB) trained on real swipe data
  • Sub-200ms predictions with XNNPACK hardware acceleration
  • Autocorrect with contraction support — "dont" to "don't", "im" to "I'm"
  • Full inference control — beam width, length normalization, pruning, early stopping
  • 100% on-device — works in airplane mode, no cloud anything

🌍 Multi-Language with Hot-Swap

  • 11 swipe languages — 6 bundled, 5 downloadable packs
  • Primary + secondary language — neural network evaluates both dictionaries per swipe
  • Instant language switch — toggle between languages without reloading
  • Per-language custom dictionaries — add words, adjust frequency weights, disable entries
  • Smart contractions — language-aware handling across English, French, and more

📋 Clipboard System

As an IME, CleverKeys has legitimate clipboard access that other apps don't:

  • Unlimited history — configurable by count or storage size, persistent across reboots
  • Pinned entries — save important clips with drag-and-drop reordering
  • Built-in todo list — track items with active/planned/completed status and tags
  • Inline editing — edit any clipboard entry directly in the panel
  • Regex search — VSCode-style .* toggle, glob shorthand, full regex power
  • Media clipboard — images, videos, PDFs with thumbnail previews
  • Tags — organize pinned and todo entries with custom tag labels
  • Export/Import — JSON (text) or ZIP (full backup with media)

🎮 Offline GIF Panel

  • No internet permission — GIF packs imported via file picker, not downloaded
  • FTS4 search — find GIFs by keyword with compound word fallback
  • Category browsing — 17 emotion categories + recently used
  • Community packs — import ZIP packs from Discord or build your own

🎯 208 Short Swipe Actions

Assign custom actions to any key's 8 swipe directions:

  • 204+ built-in commands — navigation, editing, clipboard, function keys, special chars
  • Custom text macros — email addresses, signatures, code snippets, emoji sequences
  • Android intents — launch any app, Termux commands, system settings, maps, browser
  • Visual feedback — custom icons displayed as sublabels on keys
  • Import/Export — share customizations as JSON profiles

🖱️ Cursor & Text Control

  • TrackPoint navigation — IBM/Lenovo-style joystick cursor on nav key (hold to activate)
  • Selection-Delete — hold backspace + swipe to highlight text, release to delete
  • Backspace undo — press backspace after autocorrect to revert to original word
  • Arrow keys — full cursor control with shift-select support

🔒 Privacy First

  • Zero network permissions — literally cannot phone home
  • No analytics, telemetry, or cloud sync
  • Password manager privacy — exclude clipboard from 1Password, Bitwarden, KeePassDX, etc.
  • Open source = auditable

⌨️ 100+ Keyboard Layouts

  • QWERTY, AZERTY, QWERTZ, Dvorak, Colemak, and programming layouts
  • International layouts for 30+ languages
  • Full XML customization with 8 sublabels per key
  • Terminal mode with Ctrl/Meta/Fn for Termux

🎨 35+ Themes with DIY Creator

  • Material You (Monet), Rose Pine, Everforest, Cobalt, ePaper, and more
  • Full control: key colors, label colors, borders, swipe trail effects
  • Dark and light variants for every theme

🌍 Multi-Language Swipe Typing

CleverKeys supports swipe typing in 11 languages with intelligent multi-language features:

⚠️ Current swipe-typing scope — The v1 gesture engine is trained on English + QWERTY. It works well for other Latin-script languages that share the QWERTY keyboard (Spanish, French, Portuguese, Italian, German, etc.), but quality degrades for non-QWERTY layouts (AZERTY, QWERTZ, Dvorak, Colemak) and for non-Latin / non-romance scripts, where swipe is automatically disabled on keyboards whose row shape diverges from QWERTY (see #9). A new multi-layout / multi-script gesture model with layout-aware decoding is on the roadmap for Q2–Q3 2026; in the interim, tap typing + autocorrect works across every supported layout and language.

Bundled Languages (6)

Included in the APK — no additional download required:

Language Code Dictionary Size
English en 52,000 words
Spanish es 50,000 words
French fr 25,000 words
Portuguese pt 25,000 words
Italian it 25,000 words
German de 25,000 words

Downloadable Language Packs (5)

Available via Settings → Languages → Download Language Packs:

Language Code Dictionary Size Source
Dutch nl 20,000 words wordfreq
Indonesian id 20,000 words wordfreq
Malay ms 20,000 words wordfreq
Tagalog tl 20,000 words wordfreq
Swahili sw 20,000 words Wikipedia corpus

Multi-Language Features

Primary + Secondary Language

  • Set your primary language for main typing
  • Add a secondary language for automatic detection
  • Neural network evaluates both dictionaries simultaneously
  • Best prediction selected automatically per swipe

Smart Accent & Punctuation Insertion

  • Automatic accent marks for languages that need them (café, naïve, señor)
  • Language-aware punctuation (Spanish ¿¡, French « », German „")
  • Proper handling of contractions across languages

Per-Language Dictionary Manager

  • Separate tabs for each active language
  • View word frequencies and dictionary statistics
  • Add custom words per language
  • Import/export language-specific word lists

Creating Custom Language Packs

You can create dictionaries for any language using the included Python scripts:

# Navigate to scripts directory
cd scripts/

# Install prerequisite
pip install wordfreq

# Option 1: Two-step build from wordfreq (any language wordfreq supports)
python get_wordlist.py --lang fr --output fr_words.txt --count 50000
python build_langpack.py --lang fr --name "French" --input fr_words.txt --use-wordfreq --output langpack-fr.zip

# Option 2: Build from pre-existing binary dictionary (.bin file)
python build_langpack.py --lang sv --name "Swedish" --dict ../src/main/assets/dictionaries/sv_enhanced.bin --output langpack-sv.zip

# Option 3: Build from custom word frequency CSV (format: word,frequency per line)
python build_dictionary.py --input my_words.csv --output my_lang.bin
python build_langpack.py --lang xx --name "MyLang" --dict my_lang.bin --output langpack-xx.zip

# Option 4: Batch build all bundled languages (en, es, fr, de, it, pt, nl, id, ms, tl, sw)
python build_all_languages.py

Script Details:

  • build_langpack.py — Creates complete .zip language packs from wordfreq
  • build_dictionary.py — Builds binary dictionary from CSV word lists
  • build_all_languages.py — Batch builds all supported languages
  • get_wordlist.py — Extracts top N words from wordfreq for a language

Language packs are simple .zip files containing:

  • {lang}_enhanced.bin — Binary dictionary with frequency data
  • {lang}_enhanced.json — Human-readable word list with frequencies
  • manifest.json — Metadata (language code, version, word count)

Pre-built Language Packs: Available in scripts/dictionaries/ for testing, or download directly from the app.

📖 Documentation

📚 Tech Stack & Open-source Libraries

  • Minimum SDK level 26 (Android 8.0+)
  • Kotlin based — 100% Kotlin, zero Java
  • ONNX Runtime — Microsoft's cross-platform inference engine
  • Kotlin Coroutines — Asynchronous processing
  • Flow — Reactive data streams
  • Material 3 — Google's latest design system

🔧 Building from Source

Requirements

  • Android SDK (API 26+)
  • Gradle 8.6+
  • Kotlin 1.9.20
  • JDK 17

Commands

# Clone repository
git clone https://github.com/tribixbite/CleverKeys.git
cd CleverKeys

# Debug build
./gradlew assembleDebug

# Run tests
./gradlew test

# APK location
# build/outputs/apk/debug/cleverkeys.apk

Termux Users

Use the included build script which handles ARM64-specific AAPT2:

./build-on-termux.sh

🧠 The ML Model

CleverKeys uses a custom transformer neural network model for gesture recognition:

Component Details
Architecture Encoder-Decoder Transformer
Encoder Processes swipe trajectories (x, y, velocity, acceleration, nearest keys)
Decoder Generates word predictions from encoded features
Format ONNX (cross-platform, optimized inference)
Runtime ONNX Runtime 1.20.0 with XNNPACK acceleration
Total Size ~13MB (encoder + decoder)

Training code, model architecture, and datasets: CleverKeys-ML

☕ Buy me a coffee

This application is completely free and open source. If you want to support continued development, you can send a donation via the methods below:


Solana

triQem2gDXHXweNceTKWGfDfN6AnpCHmjR745LXcbix

❤️ Credits & Acknowledgments

Unexpected Keyboard

CleverKeys began as a fork of Unexpected Keyboard by Jules Aguillon (@Julow). The original is an excellent, highly customizable keyboard with support for 100+ layouts.

Our projects have since diverged significantly (~900 commits apart):

  • Complete rewrite from Java to Kotlin with coroutines and Flow
  • Neural network gesture typing (ONNX transformer model)
  • Full clipboard system (unlimited history, pinning, todos, tags, inline editing, regex search, media)
  • Offline GIF panel with FTS4 search
  • Multi-language simultaneous prediction with per-language dictionary management
  • Autocorrect with contraction support
  • 1000+ automated tests (JVM + instrumented)

If you want a lightweight keyboard without gesture typing, we recommend the original Unexpected Keyboard.

Neural Network Model Research

⭐ Star History

Star History Chart

📢 Support

⚖️ License

CleverKeys - Neural Gesture Keyboard for Android
Copyright (C) 2024-2026 tribixbite

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.


Built with Kotlin, ONNX, and a commitment to privacy.
Developed in Termux on Android.

🦝✨

About

Privacy-first neural Android keyboard with advanced swipe prediction

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors