Skip to content

tribixbite/CleverKeys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

CleverKeys


API Kotlin ONNX Runtime Material 3




πŸ—ΊοΈ Project Overview

CleverKeys is the only fully open-source neural network gesture keyboard for Android. Featuring an AI-powered swipe engine that runs entirely on-device, unlimited clipboard history, and a powerful theme engine with DIY customization. No proprietary libraries. No cloud dependencies. No data collection.

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
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 items ❌ 15s hint only
Short-Swipe Actions⁸ βœ… 208 gestures ⚠️ Limited ❌ ⚠️ Limited ⚠️ Limited
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

Why CleverKeys?

CleverKeys uses a custom transformer neural network (encoder-decoder architecture) trained specifically for swipe typing. Unlike algorithmic approaches, neural models learn complex patterns from real swipe data. The model architecture, training code, and datasets are all publicly available at CleverKeys-ML β€” making it fully reproducible and auditable.

Key differentiators:

  • Only keyboard with public ML training pipeline β€” verify exactly how the model was trained
  • ONNX format β€” cross-platform, hardware-accelerated inference via XNNPACK
  • Sub-200ms predictions β€” optimized for mobile with beam search decoding
  • 208 customizable short-swipe gestures β€” 8 directions Γ— 26 letter keys

Unlimited Clipboard History

Android restricts clipboard access for security - apps can't read clipboard contents in the background. But keyboards are special. As an Input Method Editor (IME), CleverKeys has legitimate clipboard access, making it the only way to get truly unlimited clipboard history without root.

πŸ“± Reliable Swipe Typing in Termux

CleverKeys is the only open-source keyboard with reliable swipe/gesture typing in Termux. Other keyboards either disable gestures in terminals (FlorisBoard), produce corrupted output (HeliBoard), or simply don't work (FUTO). Commercial keyboards like Gboard and SwiftKey also disable swipe in Termux. CleverKeys works everywhere β€” including terminal emulators, SSH sessions, and developer tools.

πŸ“² 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 Network Gesture Recognition

  • Transformer-based encoder-decoder model (5.4MB encoder + 7.4MB decoder)
  • Sub-200ms predictions with hardware acceleration (XNNPACK)
  • 100% local processing β€” works in airplane mode
  • Full inference control β€” beam width, length normalization, pruning, early stopping

πŸ“‹ Unlimited Clipboard History

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

  • Unlimited history (configurable by count or storage size)
  • Pin important items
  • Search through history
  • Persistent across reboots
  • Export/Import for backup

πŸ”’ Privacy First

  • Zero network permissions β€” literally cannot phone home
  • No analytics or telemetry
  • No cloud sync
  • All processing on-device
  • Open source = auditable

βš™οΈ Full Prediction Control

Unlike black-box keyboards, CleverKeys exposes all parameters:

  • Beam search tuning (width, length normalization, pruning)
  • Autocorrect settings (thresholds, style presets)
  • Dictionary control (custom words, frequency adjustments)
  • Gesture sensitivity and thresholds

⌨️ 100+ Keyboard Layouts

Inherited from Unexpected Keyboard:

  • QWERTY, AZERTY, QWERTZ, Dvorak, Colemak
  • Programming layouts with special characters
  • International layouts for 30+ languages
  • Customizable bottom row and modifiers

πŸ› οΈ Power User Features

  • Terminal mode β€” Ctrl/Meta/Fn keys for Termux users
  • Short swipe gestures β€” Swipe keys for symbols, navigation, clipboard, and function keys (inherited from Unexpected Keyboard)
  • Backup & Restore β€” Export all settings and custom data

πŸ“š 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
  • Addition of gesture typing via custom neural network model
  • Clipboard history system
  • Different architecture (coroutines, ONNX integration)

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

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published