Skip to content

feat: swipe to type#451

Draft
oneshinyboi wants to merge 13 commits intowlx-team:mainfrom
oneshinyboi:main
Draft

feat: swipe to type#451
oneshinyboi wants to merge 13 commits intowlx-team:mainfrom
oneshinyboi:main

Conversation

@oneshinyboi
Copy link
Contributor

I found this new library a few days ago which supports swipe to type for rust, so Ive forked it here, adding some improvements to the prediction selection alg, and laying the groundwork for multi language support.

You can see a some debug output showing the predictions based on the swipe data here:

vid
for example the output

swipe path: tyuiopoiuytre
[Prediction { word: "type", score: 0.0, freq: 0.5063510374694056, bigram_prob: None }, Prediction { word: "types", score: 0.1, freq: 0.4162008418819938, bigram_prob: None }, Prediction { word: "topped", score: 0.0824621125123532, freq: 0.33165337313381665, bigram_prob: None }, Prediction { word: "tippee", score: 0.0, freq: 0.0, bigram_prob: None }, Prediction { word: "topee", score: 0.0, freq: 0.0, bigram_prob: None }]

is showing that I swiped over the keys "tyuiopoiuytre" in that order and its correctly predicting that I meant to type the word "type"

Before I continue to implement it properly with the gui and stuff I have a question:

Ive currently implemented the library such that it precompiles word counts and word bigrams into binaries for each language (currently only english) in the crate itself, so the engine can load faster at runtime. its too big for crates.io so it has to be installed via git. This also means the builds will be substantially larger for example the release build binary is now 70mb, compared to 43mb before. I estimate this will increase by about ~30mb per language added. is this acceptable?

@galister
Copy link
Collaborator

galister commented Feb 26, 2026

Impressive!

I think we will likely not want to bundle the dictionaries but load them from the internet on user request, like how many Android keyboards handle dictionary downloads.

The dictionaries could be in ~/.cache or ~/.local/share.

We can also implement a UI for the user to pick the desired word, as well as a way to render a trail line (@oo8dev might have ideas about the latter)

@oo8dev
Copy link
Collaborator

oo8dev commented Feb 26, 2026

Yup, I've implemented WidgetCustomDraw widget (in the separate branch) in which you can put your own callback to have direct access to drawing functions, for example rectangles or sprites. No polygon/line support though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants