Skip to content

tactus 0.1.0: an on-screen keyboard that corrects words as they are typed, opt-in beside squeekboard - #888

Open
W4HO-ham wants to merge 2 commits into
derekross:mainfrom
W4HO-ham:tactus-keyboard
Open

W4HO-ham wants to merge 2 commits into
derekross:mainfrom
W4HO-ham:tactus-keyboard

Conversation

@W4HO-ham

@W4HO-ham W4HO-ham commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

squeekboard types what is tapped and nothing else. Tactus is a second keyboard an owner may install beside it. It corrects words as they are typed, the way the keyboards on current phones do. It is opt-in: no image installs it, nothing depends on it, and squeekboard stays the phone's keyboard until the owner picks Tactus in Setup > Keyboard.

Tactus under a text field Setup > Keyboard: Standard, and Tactus with a tick

The sentence in the picture was typed as "im typing on Tactus. teh keyboard fixes slips as you go, and dont worry about capitals", with Shift pressed once, for the T of Tactus.

What it does:

  • corrects a word when it is ended, by where each tap landed in its key, how common the word is and the usual slips (two letters swapped, one missed or doubled, a missed space, a missing apostrophe);
  • Backspace right after a correction puts back what was typed, and a word put back once is kept from then on;
  • a sentence starts with a capital, two spaces make a full stop, a double tap on Shift locks it;
  • a long press offers a letter's accented forms, a slide on the held space bar moves the cursor, Backspace held deletes letters and then words;
  • an emoji page with large emoji that slide sideways and a search;
  • a microphone key for the phone's dictation, and a swipe down to put the keyboard away.

It draws itself in the applied Omarchy theme's colours, as squeekboard is styled: the panel in the theme's darker background, the keys in its lighter one, the letters in its foreground, the caret in its accent. When Omarchy applies another theme it takes the new colours at once (it watches theme.generation). Without a theme it has light and dark colours of its own, and an owner who prefers those can keep them (~/.config/tactus/own-colours).

What it doesn't do: it is English only (another language's layout types without corrections, and I haven't tried one on a phone), it has no row of suggestions, no Paste key and no globe. A field that declares no purpose gets corrections like a chat field, and the lock screen's password field is untried. The README lists the rest.

How it is put together:

  • packages/tactus builds from Stevia 0.59.0 (GPL-3.0-or-later, COPYING beside it): six patches to Stevia's files, each with its reason in its header and the files' upstream notices kept, plus Tactus's own sources (the typing engine, the autocorrection, the drawing) and their checks, each with its copyright line. It installs under /usr/lib/tactus with the binary named tactus, so it sits beside squeekboard; Arch's stevia package conflicts with squeekboard. Stevia's own word completion is off by a settings default in the package's own schemas. The word counts are hermitdave's FrequencyWords (CC-BY-SA-4.0), fetched at the first commit whose README gives that licence; the file is the same since it was added.
  • Choosing it takes the shell's part, which is now its own pull request, omamobile-shell 0.2.134: a choice of on-screen keyboard in Setup > Keyboard, squeekboard unless the owner picks Tactus #896: omamobile-osk, the start line, the drop-in, Setup > Keyboard and phone.lua's lists.

Two things worth knowing.

Chromium. With text-input-v3 it sends new state only once the last done's serial equals its count of commits, and Hyprland sends a text field done only when the keyboard commits something. Left alone, Chromium's surrounding text is one key behind, and since it takes text away counting from the cursor it last told of, a correction sent then deletes nothing and the right word lands after the wrong one. So Tactus answers the text field: an empty input-method commit after a field's first sign of life and after every report with text, and a key that would take text away waits up to a quarter of a second for the field to show what was sent before it. GTK applies nothing on an empty done and sends nothing back. The typing engine's test has a browser-like field, answered and unanswered.

The room it reserves. The panel's top corners are round, and what shows past them should be the application in front, not the wallpaper. So the keyboard reserves a little less room than its panel is high (8 px on a screen 360 wide), the window reaches that far under the panel's top, and the corners are cut no deeper. The cost is that this much of a window's lower edge is behind the keyboard. A taller page (the emoji) takes its room only once it is on the screen, and a lower one gives it back at once, so the wallpaper doesn't show between the window and the keyboard while the page changes.

Tested:

  • packages/tactus builds with makepkg in the project's Arch Linux ARM build image, check() included: the typing engine against make-believe text fields (126 checks), the word list, the keys (80, with the theme's colours, the fallback and the owner's choice of Tactus's own) and the emoji page (28) off screen, and a run with the trace and the debug lines on that holds nothing typed. test/all --upstream applies the patches to the untouched Stevia 0.59.0 with no fuzz.
  • On my Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty): the package installed, chosen in Setup > Keyboard by touch, changed to squeekboard and back, and started by itself after each reboot. It typed and corrected in a GTK 3 text view, in Chromium 156 (a text area, an editable block, a one-line field: slips corrected, two spaces, Backspace, an emoji) and in a GPUI application, in light and in dark. With the keyboard up the compositor kept 259 px for a panel 267 px high, and no wallpaper showed past the corners or while the page changed from letters to emoji. It has been my keyboard since 2026-11-17.
  • tests/packages fails in omamobile-omarchy on my laptop with and without this change (qmlformat on two of the installed Omarchy's files), nothing else.

Not tested: the theme's colours on a phone (off screen only so far; I'll post a picture from my 9a tonight), other languages' layouts, Qt applications, the lock screen's password field, a phone on its side, and any phone but the 9a.

Your call, not decided here:

  • whether the root image should carry the package, and whether Install should get a row for it. As it stands an owner installs it with pacman;
  • tools/build-packages builds it by default, like any package directory. It is a C build of 136 compile steps: under half a minute natively on an arm64 build machine, and I haven't timed it under qemu-user. If that is too slow for the daily run it could join the packages built only when named.

The shell part's version is set in #896.

@derekross

Copy link
Copy Markdown
Owner

Thank you. This is a lot of careful work, and the write-up is the kind I wish every PR had: what it does, what it doesn't, what ran where and what didn't. I read the typing engine and the autocorrection in full (tactus-typer.c, tactus-autocorrect.c), patches 0001, 0002 and 0006, the PKGBUILD, the tests' runner and all of the shell's changes. I did not read the bodies of patches 0004 and 0005 or the six test programs; for those I checked that no added line starts a process, opens a file or a socket, or reads the environment. I downloaded both sources: the two sha256 sums match what GitLab and GitHub serve today, and your six patches apply to the untouched Stevia 0.59.0 with no fuzz. The answer to the Chromium done problem is a real find.

It can't merge as it is, and most of why is mine to decide rather than yours to fix. Please let me come back on these:

  • Publishing it. The package adds two download hosts to the machine that builds and signs the project's repository, and by default the nightly would build it, run its check() and publish it. I'm being careful with that machine at the moment. If I take it, it will be built only when named at first, as you offered.
  • Its look. The phone's keyboard follows the applied Omarchy theme; Tactus has two palettes of its own. The shell shouldn't offer a keyboard that doesn't follow the theme, so please take the colours from the applied theme (the source hooks/theme-set-keyboard uses for squeekboard).
  • GPL-3.0 sources in this repository. CONTRIBUTING §7 lists the exceptions to MIT and this isn't one yet; that line is mine to write.

What I'd ask you to change:

  1. Split it in two: the shell's part (omamobile-osk, the start line, the drop-in, the menu, phone.lua) and the tactus package. The shell part changes how every phone starts squeekboard, mine included, whether or not Tactus is installed, and you say the shell package itself never ran on your 9a. I'll run that one on my Pixel 7 Pro before it merges.
  2. A start line that survives the script going away. Once the user's autostart.lua says o.launch_on_start("omamobile-osk"), installing an older omamobile-shell (a branch build without this change) leaves a line that starts nothing, at every login, and the done-marker means it is never put back. On a phone whose lock takes a password rather than the PIN pad, that may mean no way to unlock it. Something like sh -c 'command -v omamobile-osk >/dev/null && exec omamobile-osk; exec squeekboard' in the line keeps a keyboard either way.
  3. test/osk.sh reads the real /usr/bin. Its first block expects Tactus not to be installed, with PATH="$F:/usr/bin:/bin". On a phone that has Tactus (yours) command -v tactus finds it, the case fails, and omamobile-shell's check() fails with it. A PATH of the fakes plus links to bash, head, tr and id fixes it.
  4. Patch 0005 removes the upstream notices from pos-emoji-picker.c (The Phosh Developers, Guido Günther, and the "based on GTK's gtkemojichooser.c, Red Hat, Matthias Clasen" lines) while part of that file remains. Please keep them and add Tactus's line under them, as patch 0004 does for the key widget.
  5. The word list's licence. At the commit you pin, FrequencyWords' README says "CC-by-sa-3.0 for contents"; it says 4.0 from a later commit, and the file is byte-identical on master. Please pin a commit whose README says 4.0 (the sha256 doesn't change) or cite 3.0, in WORD-COUNTS, the PKGBUILD and the README.
  6. The licence text and headers: a COPYING (GPL-3.0) in packages/tactus/, an SPDX line on its README, and a copyright line on your own source files.
  7. The debug lines. tactus-typer.c ('%s' -> '%s', put back '%s') and tactus-autocorrect.c ('%s' ... against '%s') print the typed word under g_debug. They're off by default, but with G_MESSAGES_DEBUG=all in a session every corrected word goes to the journal, and the README promises it never says what was typed. Letter counts there, as in the trace, would keep the promise.

Two smaller things for the README's limits: an application that declares no purpose for its field (a GPUI editor or terminal) gets corrections like any chat field, and the lock screen's password field is untried, which matters more than the others on that list.

On the version: #886, #887, #890 and #204 also say omamobile-shell 0.2.134. This one will merge last of them, so the shell part takes whatever is free then; I'll give you the number when it's ready.

@W4HO-ham W4HO-ham changed the title tactus 0.1.0, omamobile-shell 0.2.134: an on-screen keyboard that corrects words as they are typed, chosen in Setup > Keyboard tactus 0.1.0: an on-screen keyboard that corrects words as they are typed, opt-in beside squeekboard Nov 18, 2026
@W4HO-ham

W4HO-ham commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you for reading it this closely. Done, as two pull requests now:

  1. Split. The shell's part is omamobile-shell 0.2.134: a choice of on-screen keyboard in Setup > Keyboard, squeekboard unless the owner picks Tactus #896 (omamobile-osk, the start line, the drop-in, Setup > Keyboard, phone.lua). This branch is now the tactus package and its two pictures, one commit on current main.
  2. The start line in omamobile-shell 0.2.134: a choice of on-screen keyboard in Setup > Keyboard, squeekboard unless the owner picks Tactus #896 falls back to squeekboard where omamobile-osk is gone: sh -c 'command -v omamobile-osk >/dev/null && exec omamobile-osk; exec squeekboard'. test/setup-user.sh runs the line with the script there and without it.
  3. test/osk.sh has only the fakes and links to the real tools the script and the fakes use on its PATH.
  4. Patch 0005 keeps the Phosh Developers', Guido Günther's and the GTK (Red Hat, Matthias Clasen) lines of pos-emoji-picker.c, with Tactus's description and a copyright line under them, as 0004 does.
  5. The word list is pinned at 34bb6447, the first commit whose README says CC-by-sa-4.0. The file is byte-identical to 072bbed2's (same sha256), so the PKGBUILD's checksum is unchanged. WORD-COUNTS says both.
  6. Licence text and headers: packages/tactus/COPYING is the GPL-3.0, the README starts with an SPDX line, and each of my own files has Copyright (C) 2026 W4HO. test/all checks all three.
  7. The debug lines in the typing engine and the autocorrection print letter counts now. test/all refuses a g_debug with a %s there, and the built check runs the typing test with G_MESSAGES_DEBUG=all as well as the trace, and looks for the typed words in both.

The look: Tactus now takes its colours from the applied theme's colors.toml, the file omamobile-keyboard-theme reads for squeekboard. The panel is the darker background, the keys the lighter one, the letters the foreground and the caret the accent, with the emoji page's search field, hint and signs mixed from those. It watches theme.generation, so a new theme reaches it without a restart. Without a theme file it keeps its own light and dark, and an owner can choose those with ~/.config/tactus/own-colours. The keys' test checks the mapping, a light theme, a theme file without the two colours it needs, and the owner's choice.

The README also has the two limits you named.

test/all (with --upstream and --built), tests/all and tools/pr-check origin/main pass on both branches. I'll post the palmtop's run of the new build with the theme tonight, when it is off its sleep series.

On publishing, the look and the licence line: understood, and I'll wait for you.

…yped, opt-in beside squeekboard

squeekboard types what is tapped and nothing else. Tactus is a second keyboard an owner may install beside it: it corrects a word when it is ended (by where each tap landed in its key, how common the word is and the usual slips), puts back what was typed on a Backspace right after, starts sentences with a capital, makes a full stop of two spaces, offers a letter's accented forms on a long press, and has an emoji page with a search. English only, and opt-in: no image installs it, nothing depends on it, and squeekboard stays the phone's keyboard until the owner picks Tactus. It draws itself in the applied Omarchy theme's colours, and takes a new theme's at once; without a theme, or where the owner keeps them, it has light and dark colours of its own.

packages/tactus builds it from Stevia 0.59.0 (GPL-3.0-or-later): six patches to Stevia's files, each with its reason in its header and the files' upstream notices kept, and Tactus's own sources (the typing engine, the autocorrection, the drawing) with the checks that run with no window. Everything is installed under /usr/lib/tactus with the binary named tactus, so it sits beside squeekboard, which Arch's stevia package conflicts with. Stevia's own word completion is off by a settings default compiled into the package's own schemas. The word counts are hermitdave's FrequencyWords (CC-BY-SA-4.0), fetched at the first commit whose README gives that licence (the file is the same since it was added).

Choosing it takes the shell part, omamobile-osk and Setup > Keyboard, which is its own pull request (derekross#896). The typing engine's trace and its debug lines name letter counts, never what was typed.

In Chromium the keyboard has to answer the text field. Chromium (156, text-input-v3) sends new state only once the last done's serial equals its count of commits, and Hyprland sends a text field done only when the keyboard commits something, so its surrounding text is one key behind and a delete_surrounding_text sent then is dropped: the corrected word lands after the wrong one. Tactus sends an empty input-method commit after a field's first sign of life and after every report with text, and a key that would take text away waits up to a quarter of a second for the field to show what was sent before it. The typing engine's test has a browser-like field, answered and unanswered.

The panel's top corners are round, and what shows past them is the application in front, not the wallpaper: the keyboard reserves a little less room than its panel is high (8 px on a screen 360 wide), so the window reaches that far under the panel's top, and the corners are cut no deeper. A taller page takes its room only once it is on the screen and a lower one gives it back at once, so the wallpaper doesn't show between the window and the keyboard while the page changes.

Tested: packages/tactus builds with makepkg in the project's Arch Linux ARM build image, check() included (typing 126 checks, the word list, the keys 80 with the theme's colours, the fallback and the owner's choice of Tactus's own, the emoji page 28, and a run with the trace and the debug lines on that holds nothing typed); test/all with --upstream applies the patches to the untouched Stevia 0.59.0 with no fuzz. On a Pixel 9a the package was installed, chosen in Setup > Keyboard by touch, changed to squeekboard and back, and started by itself after each reboot; it typed and corrected in a GTK 3 text view, in Chromium 156 (a text area, an editable block, a one-line field) and in a GPUI application, in light and in dark, and with the keyboard up no wallpaper showed past the corners or while the page changed. The theme colours ran off screen only so far.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for turning this round so quickly, and for doing all of it. I checked each point on the new head:

  • The split is clean: this branch now touches only packages/tactus/ and its two pictures.
  • Patch 0005 keeps the Phosh Developers', Guido Günther's and the GTK lines, and no patch removes a notice any more.
  • The word list: I downloaded the file and the README at 34bb6447. The README says CC-by-sa-4.0 and the file's sha256 is the one the PKGBUILD pins.
  • COPYING is byte for byte Stevia's, the README has its SPDX line, and your twelve files have their copyright line.
  • The debug lines print letter counts.
  • Your six patches still apply to the untouched Stevia 0.59.0 with no fuzz (I downloaded it again; its sum matches too).
  • The colours: I read the new part of tactus-draw.c in full. It reads the applied theme's colors.toml, falls back to its own palettes, and follows theme.generation. That is what I asked for. I'd like to see it on the palmtop before calling it done, so the run you mention is welcome, with a fresh letters.png (the one in the branch still shows the old greys) and one picture after a theme change.

Nothing more is needed from you on the code. What is left is mine, as I said last time: whether and how the project's repository carries the package, and the line in CONTRIBUTING for GPL-3.0 sources. One thing I'll have to arrange if I take it: as the tree stands, the nightly would build and publish any new package folder, so tactus would go on the "built only when named" list first. I'll come back to you on both.

Two small things for the next push, no hurry: the README says "a pull request of its own (#896)", which reads oddly once both are merged (name omamobile-osk instead), and the PKGBUILD's "omamobile-shell 0.2.134 and later" will follow whatever number #896 lands with.

@derekross

Copy link
Copy Markdown
Owner

The decision I owed you: yes in principle. Tactus goes into the project's repository as an opt-in package, with the current keyboard staying the default, and CONTRIBUTING gets its line for GPL-3.0 packages (#910).

One condition before I merge it: I try it on my own Pixel 7 Pro first. I'm travelling with the phone today, so that comes after I'm back. When it merges, tactus goes on the list of packages built only when named, so the nightly doesn't publish it before a release is meant to carry it.

Order stays as I said: #896 first (after its test fix and my run), then this.

…ead of a pull request

From the review of derekross#888. letters.png now shows the keyboard as the palmtop draws it in Omarchy's Tokyo Night theme, and theme-light.png the same keyboard a moment after omarchy-theme-set catppuccin-latte, beside the README's words on the colours. The README names omamobile-shell's omamobile-osk (and its fallback to squeekboard) rather than the pull request it comes in, and the PKGBUILD's comment no longer carries a version number for it.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thank you for the decision. The pictures are in 559a1d3, taken on my palmtop this evening with the package built from 9f82793 installed:

  • docs/screenshots/tactus/letters.png: the keyboard as it draws itself in Omarchy's Tokyo Night, the palmtop's own theme (the README's first picture).
  • docs/screenshots/tactus/theme-light.png: the same keyboard a moment after omarchy-theme-set catppuccin-latte, with nothing restarted; the README's colours section shows it. The theme went back to Tokyo Night after, and the keyboard with it.

Both are cropped to the keyboard. The two small things are in the same commit: the README names omamobile-osk (and its fallback to squeekboard from #896) rather than the pull request, and the PKGBUILD's comment no longer carries a version number. The package's test/all, tests/all and tools/pr-check origin/main pass.

Understood on the order and on tactus going on the "built only when named" list.

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.

2 participants