WM Keyboard plugins
Plugins are small sandboxed Lua scripts that add tools to the keyboard.
A plugin is a small Lua script that adds a tool to the keyboard. It draws a panel (some text, a few buttons, maybe a text box) and does whatever you write it to do.
function render() return ui.column { ui.label { text = "Hello!", style = "title" }, ui.button { id = "wave", text = "Wave back" }, }end
function on_event(e) if e.id == "wave" then wm.log("👋") endendThat is a complete plugin, minus its plugin.json.
You can also write one on the phone. WM KeyboardToolsPluginsWrite a plugin opens an in-app editor with a live preview and starter templates, and its Install button installs the result directly, with no ZIP file.
Start here
Section titled “Start here”What a plugin can do
Section titled “What a plugin can do”Compute things, and draw its own panel. That is genuinely the whole list.
What a plugin cannot do
Section titled “What a plugin cannot do”- See what you type. There is no key event API. A plugin cannot observe, change or delay a single keystroke going to your app.
- Read the text you are writing in. No API returns the contents of the field.
- Read your clipboard. No API.
- Use the internet. No HTTP, no sockets, no URLs.
- Reach Android. No files, no reflection, no other apps, no device information, no permissions of its own.
- Run in the background. A plugin only runs while its panel is open.
Text still gets into a plugin: you type into its box, or tap Paste on it. Results come back out when you tap Insert under a result. Both directions are a deliberate tap, on a control the keyboard drew.
Trying the examples
Section titled “Trying the examples”The five demo plugins in the addon repository are meant to be read:
| Plugin | Shows |
|---|---|
| Cipher Tool | Tabs, inputs, buttons, insertable output. The getting-started build. |
| UI Kitchen Sink | Every widget and every event, with a live event log. |
| Todo List | wm.storage. The one capability a plugin can ask for. |
| Text Tools | The paste-in, transform, insert-out flow. |
| Math Mode | A real text engine: a tokenizer, symbol tables, a live result on every keystroke, and options kept in wm.storage. |
