An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# 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 | 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


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](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:

| ![Solana](https://img.shields.io/badge/Solana-9945FF?style=for-the-badge&logo=solana&logoColor=white)

`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

# โญ Star History





Star History Chart

# ๐Ÿ“ข Support

- **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.


๐Ÿฆโœจ