https://github.com/tribixbite/cleverkeys
Privacy-first neural Android keyboard with advanced swipe prediction
https://github.com/tribixbite/cleverkeys
android-app android-keyboard apk clipboard-manager mobile-keyboard onnx todolist
Last synced: about 2 months ago
JSON representation
Privacy-first neural Android keyboard with advanced swipe prediction
- Host: GitHub
- URL: https://github.com/tribixbite/cleverkeys
- Owner: tribixbite
- License: gpl-3.0
- Created: 2025-09-15T09:07:00.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2026-04-26T04:20:01.000Z (about 2 months ago)
- Last Synced: 2026-05-04T00:37:33.047Z (about 2 months ago)
- Topics: android-app, android-keyboard, apk, clipboard-manager, mobile-keyboard, onnx, todolist
- Language: Kotlin
- Homepage: https://cleverkeys.app
- Size: 957 MB
- Stars: 333
- Watchers: 2
- Forks: 24
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Security: SECURITY.md
- Roadmap: ROADMAP.md
- Agents: AGENTS.md
Awesome Lists containing this project
README

# CleverKeys

# ๐บ๏ธ 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 | Urik |
|---------|:----------:|:---------:|:----:|:-----------:|:---------------:|:----:|
| **Gesture Typing in Termux** | โ
| โ ๏ธ Corruptedโด | โ Broken | โ ๏ธ Disabled | โ ๏ธ Experimental | โ |
| **Gesture/Swipe Typing** | โ
Stable | โ
Stable | โ ๏ธ Alpha | โ ๏ธ Disabledโต | โ ๏ธ Experimental | โ
Geometricยนโฐ |
| **Multi-Language Swipe**โน | โ
11 languages | โ ๏ธ Single | โ ๏ธ English only | โ | โ | โ
Simultaneous |
| **Gesture Engine Open Source** | โ
| โยน | โ
ยฒ | โ
| โ
| โ
|
| **ML Training Code Public** | โ
| N/A | โ
โถ | N/Aยณ | N/Aยณ | N/Aยนโฐ |
| **Model Size** | 13MB | Proprietary | 62MB | N/A | N/A | N/A |
| **APK Size** | ~52MB | ~45MB | ~200MB | ~15MB | ~25MB | ~40MB |
| **Clipboard History** | โ
Unlimited | โ ๏ธ 10min defaultโท | โ
25 items | โ
20-100 items | โ 15s hint only | โ
Encrypted |
| **Short-Swipe Actions**โธ | โ
208 gestures | โ ๏ธ Limited | โ | โ ๏ธ Limited | โ ๏ธ Limited | โ ๏ธ Space/Del onlyยนยน |
| **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 | GPL-3.0 |
Footnotes & Sources
ยน HeliBoard requires Google's proprietary `libjni_latinimegoogle.so` library for gesture typing ([source](https://github.com/Helium314/HeliBoard#gesture-typing))
ยฒ FUTO uses "Source First License 1.1" โ source-available but restricts commercial use ([source](https://keyboard.futo.org/))
ยณ FlorisBoard and AnySoftKeyboard use algorithmic approaches (corner matching, template matching) โ no ML training involved
โด HeliBoard has a [known bug](https://github.com/termux/termux-app/issues/3941) 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](https://huggingface.co/datasets/futo-org/swipe.futo.org) 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.
ยนโฐ Urik uses a geometric/template path matcher (no ML model, no training code applicable) โ German-friendly QWERTZ-native with simultaneous multilingual spell-check. CleverKeys is exploring a complementary geometric pipeline for non-QWERTY layouts and non-Latin scripts (Russian, etc.) โ see [ROADMAP.md](./ROADMAP.md#-neural-network--prediction).
ยนยน Urik short-swipe is limited to Space (cursor movement) and Backspace (delete word) โ no general short-swipe action mapping system.
### 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](https://github.com/tribixbite/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
*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](https://github.com/tribixbite/CleverKeys/issues/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:
```bash
# 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/`](./scripts/dictionaries/) for testing, or download directly from the app.
#

# ๐ Documentation
- **[User Guide Wiki](https://tribixbite.github.io/CleverKeys/wiki/)** โ 38-page comprehensive documentation
- **[Feature Specifications](./docs/specs/)** โ Technical documentation for developers
- **[Changelog](./CHANGELOG.md)** โ Version history and release notes
- **[Roadmap](./ROADMAP.md)** โ Planned features and development path
# ๐ Tech Stack & Open-source Libraries
- Minimum SDK level 26 (Android 8.0+)
- [Kotlin](https://kotlinlang.org/) based โ 100% Kotlin, zero Java
- [ONNX Runtime](https://onnxruntime.ai/) โ Microsoft's cross-platform inference engine
- [Kotlin Coroutines](https://github.com/Kotlin/kotlinx.coroutines) โ Asynchronous processing
- [Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/) โ Reactive data streams
- [Material 3](https://m3.material.io/) โ Google's latest design system
# ๐ง Building from Source
### Requirements
- Android SDK (API 26+)
- Gradle 8.6+
- Kotlin 1.9.20
- JDK 17
### Commands
```bash
# 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:
```bash
./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](https://github.com/tribixbite/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:
| 
`triQem2gDXHXweNceTKWGfDfN6AnpCHmjR745LXcbix`
|
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
# โค๏ธ Credits & Acknowledgments
### Unexpected Keyboard
CleverKeys began as a fork of [Unexpected Keyboard](https://github.com/Julow/Unexpected-Keyboard) by Jules Aguillon ([@Julow](https://github.com/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
- **[Neural Swipe Typing](https://github.com/proshian/neural-swipe-typing)** by [@proshian](https://github.com/proshian) โ Initial architecture inspiration
- **[How We Swipe](https://github.com/nicosio2/how-we-swipe)** โ Research paper and dataset on swipe behavior
- **[FUTO Swipe Dataset](https://huggingface.co/datasets/nicosio2/FUTO-swipe-dataset)** โ Hugging Face dataset
- **Issues**: [GitHub Issues](https://github.com/tribixbite/CleverKeys/issues)
- **Discussions**: [GitHub Discussions](https://github.com/tribixbite/CleverKeys/discussions)
- **Security**: See [SECURITY.md](SECURITY.md)
# โ๏ธ 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.
๐ฆโจ