local ui = require "ui" local keyboard = require "keyboard" ---@class KeyboardApp : SlateApp local M = {} local valueLabel local shown = "type something" local function show(prefix, value) shown = value == "" and "type something" or prefix .. value ui.setText(valueLabel, shown) end function M.init() log.info "keyboard test ready" end function M.node() valueLabel = ui.text(shown, { w = "fill" }) return ui.box { w = "fill", h = "fill", pad = 8, gap = 5, valueLabel, keyboard.new { max_length = 40, on_change = function(value) show("value: ", value) end, on_submit = function(value) show("submitted: ", value) end, }, } end return M