DatumHuePlatform v0.0.24datumhue.com
Contents

namespaceWindow Manager10 functionsUI apps only

datumhue.wm

Manage descendant apps: terminate, focus, bounds, weight, minimize, cursor override, frame wrapping, input grabs, cancel requests, and permission grants.

Returns handles
Subscription, UiElement

The examples on this page start from:

lua
local child = datumhue.app.spawn({
    name = "notes",
    code = "datumhue.ui.root:label({ text = 'Notes' })",
})
-- A child spawned from `code` can be managed from the next frame.
datumhue.time.wait_frames(1)

Functions 10

datumhue.wm.terminate_app

functionUI apps only
datumhue.wm.terminate_app(app: App)

Terminate a managed descendant app (silent no-op if already gone).

datumhue.wm.override_cursor_icon

functionUI apps only
datumhue.wm.override_cursor_icon(icon?: input.CursorIcon)

Set the caller's cursor override (effective only while it manages the focused app); nil clears.

datumhue.wm.set_app_minimized

functionUI apps only
datumhue.wm.set_app_minimized(options: wm.SetAppMinimizedOptions)

Minimize or restore a managed app. Raises for an app living in an element of its parent (see app.spawn), which hides and shows with the element.

Example
datumhue.wm.set_app_minimized({ app = child, minimized = true })
datumhue.wm.set_app_minimized({ app = child, minimized = false })

options wm.SetAppMinimizedOptions options 2 keys

KeyTypeDefaultDescription
app requiredAppno defaultThe managed app to minimize or restore.
minimized requiredbooleanno defaulttrue to minimize, false to restore.

datumhue.wm.set_app_bounds

functionUI apps only
datumhue.wm.set_app_bounds(options: wm.SetAppBoundsOptions)

Set the position/size of a managed app. For an app living in another app's window (see app.spawn), the position is measured from that window's top-left. Raises for an app living in an element of its parent, which fills the element.

Example
datumhue.wm.set_app_bounds({
    app = child,
    x = 40,
    y = 40,
    width = 320,
    height = 200,
})
datumhue.wm.set_app_bounds({ app = child, width = 400 })

options wm.SetAppBoundsOptions options 5 keys Omitted keys keep their current value.

KeyTypeDescription
appAppThe managed app to reposition or resize.
xnumberNew x position in pixels.
ynumberNew y position in pixels.
widthnumberNew width in pixels.
heightnumberNew height in pixels.

datumhue.wm.set_app_focused

functionUI apps only
datumhue.wm.set_app_focused(app: App)

Give input focus to a managed app. The root app is the workstation's base layer: focusing it gives it input without covering the windows it manages, and its popovers stack above them.

datumhue.wm.set_app_weight

functionUI apps only
datumhue.wm.set_app_weight(options: wm.SetAppWeightOptions)

Set a managed app's layout weight.

Example
datumhue.wm.set_app_weight({ app = child, weight = 2 })

options wm.SetAppWeightOptions options 2 keys

KeyTypeDefaultDescription
app requiredAppno defaultThe managed app whose layout weight to set.
weight requirednumberno defaultRelative layout weight among siblings.

datumhue.wm.grab_input

functionUI apps only
datumhue.wm.grab_input(opts: wm.GrabOptions) -> Subscription

Reserve key chords and gamepad buttons for on_press, hiding them from this app and every app it manages. While subscribed, a press the grab takes, made while this app or an app it manages is focused, queues on_press; the press, its repeats and its release then reach nothing else in this app or the apps it manages: not their input reads, action bindings, input.on_key, input.on_text or input.on_button, their widgets, focus navigation or cancel requests. A chord takes a press of its key made while exactly its modifiers are held; a modifier pressed alone is never grabbed. When this app and one above it grab the same input, the one nearer the root takes it. A grab made while the input is held applies from its next press. Raises for a grab of nothing and for a chord or gamepad button that cannot be grabbed, naming the rule. on_release, when given, runs as each held sequence of presses the grab took ends. :unsubscribe() releases the grab.

Example
local grab = datumhue.wm.grab_input({
    chords = { { key = "k", modifiers = { "control" } } },
    gamepad_buttons = { "select" },
    on_press = function(e)
        print(e.key or e.gamepad_button)
    end,
})
grab:unsubscribe()

opts wm.GrabOptions options 4 keys

KeyTypeDefaultDescription
chordswm.Chord[]no chord is reservedKey chords to reserve.
gamepad_buttonsinput.GamepadButton[]no gamepad button is reservedGamepad buttons to reserve, on every connected pad. Only View ("select"), Menu ("start"), Guide ("mode") and the stick clicks can be grabbed: the D-pad, face buttons, bumpers and triggers stay navigation and app input.
on_press requiredfun(e: wm.GrabEvent)no defaultCalled for each press the grab takes.
on_releasefun(e: wm.GrabReleaseEvent)no defaultCalled once for each held sequence of presses the grab takes. A press it takes while no sequence is held begins one, and the presses it takes before that sequence ends join it: Control held through three presses of Tab gives three on_press calls and one on_release, as a window switcher commits when Control is let go. The modifiers of the sequence's first chord that has modifiers hold it (a later chord's extra modifiers do not), and so does the key of each chord without modifiers and each gamepad button in it, until that key or button goes up. A sequence ends at the first of: nothing holding it is held any longer, the workstation window loses keyboard focus, or a dialog of the workstation's own takes input. The event is the press that began the sequence, which can be another chord or button than the latest one, with the reason it ended. A sequence held when the grab is unsubscribed ends without one.

datumhue.wm.wrap_app

functionUI apps only
datumhue.wm.wrap_app(app: App, options?: wm.FrameInsets) -> UiElement

Wrap a managed app in a decoration frame; returns the frame's root UiElement. An app living in another app's window (see app.spawn) is lifted out into the frame, which takes the place it showed at and stacks above every window. Removing the frame hands the app back unwrapped, at the top level at the frame's bounds; the decorations built on the frame go with it. A press in the frame's window reaches you as app_frame_pressed for the wrapped app after the focus it moved there: a press in an app living in that window focuses that app first, with its app_focused before, so focusing the wrapped app in answer takes focus back from it. Raises for an app living in an element of its parent (see app.spawn): a window manager never wraps one.

Example
local frame = datumhue.wm.wrap_app(child, {
    top = 28,
    left = 4,
    right = 4,
    bottom = 4,
})
frame:label({ text = "Notes" })

options wm.FrameInsets options 4 keys

KeyTypeDefaultDescription
topnumber0Top edge inset in pixels.
bottomnumber0Bottom edge inset in pixels.
leftnumber0Left edge inset in pixels.
rightnumber0Right edge inset in pixels.

datumhue.wm.set_frame_insets

functionUI apps only
datumhue.wm.set_frame_insets(app: App, options?: wm.FrameInsets)

Change the frame insets of an already-wrapped managed app. Raises when the app has no frame; does nothing once the app has ended.

Example
datumhue.wm.wrap_app(child, { top = 28 })
datumhue.wm.set_frame_insets(child, { top = 32, left = 2, right = 2 })

options wm.FrameInsets options 4 keys

KeyTypeDefaultDescription
topnumber0Top edge inset in pixels.
bottomnumber0Bottom edge inset in pixels.
leftnumber0Left edge inset in pixels.
rightnumber0Right edge inset in pixels.

datumhue.wm.send_cancel

functionUI apps only
datumhue.wm.send_cancel(app: App)

Deliver a cancel request to a managed app, as the browser's Back or a phone's back gesture would: its source is "system", and it goes through the app's chain from its focused element (from its content area when it has no focus), then on to the frame it is wrapped in, usually the caller's own (for an app living in another app's window, the frame around that window; for one living in an element of its parent, up through the parent from that element first), in the same frame. The browser's history is never touched. Raises for an app the caller cannot manage; a silent no-op when the app has ended.

Types 6

wm.Chord

options

options 2 keys

KeyTypeDefaultDescription
key requiredinput.Keyno defaultThe key whose press the chord takes. A chord is F1-F12 or holds control, alt or super, and its key is not itself a modifier.
modifiers"control" | "alt" | "shift" | "super"[]the key goes down with no modifier heldModifiers that must all be held, and no other, as the key goes down. Either side of a modifier counts.

Nested in: wm.GrabOptions

wm.FrameInsets

options

options 4 keys

KeyTypeDefaultDescription
topnumber0Top edge inset in pixels.
bottomnumber0Bottom edge inset in pixels.
leftnumber0Left edge inset in pixels.
rightnumber0Right edge inset in pixels.

Used by: datumhue.wm.wrap_app, datumhue.wm.set_frame_insets

wm.GrabEvent

record

record 4 keys

KeyTypeDescription
key?input.KeyThe grabbed chord's key; nil for a gamepad button.
modifiers"control" | "alt" | "shift" | "super"[]The modifiers held at the press.
gamepad_button?input.GamepadButtonThe grabbed gamepad button; nil for a chord.
pad_id?integerThe gamepad pressed, numbered as input.gamepads numbers it; nil for a chord.

Nested in: wm.GrabOptions

Extended by: wm.GrabReleaseEvent

wm.GrabReleaseEvent

record

record 5 keys, 4 inherited

KeyTypeDescription
reason"released" | "focus_lost" | "modal"Why the held sequence ended.
From wm.GrabEvent
key?input.KeyThe grabbed chord's key; nil for a gamepad button.
modifiers"control" | "alt" | "shift" | "super"[]The modifiers held at the press.
gamepad_button?input.GamepadButtonThe grabbed gamepad button; nil for a chord.
pad_id?integerThe gamepad pressed, numbered as input.gamepads numbers it; nil for a chord.

Nested in: wm.GrabOptions

wm.GrabReleaseReason

enum
ValueDescription
"released"Nothing holding the sequence is held any longer.
"focus_lost"The workstation window lost keyboard focus.
"modal"A dialog of the workstation's own took input.

Nested in: wm.GrabReleaseEvent

wm.Modifier

enum
ValueDescription
"control"
"alt"
"shift"
"super"

Nested in: wm.Chord, wm.GrabEvent

datumhue.com

(c) 2026 Shuusei AB. Quote excerpts of this manual, with attribution to DatumHue, in your own documentation, tutorials, course materials, reviews, and other writing or video. Republishing it in whole or in substantial part needs written permission: support@datumhue.com.

Victor Mono is licensed under the SIL Open Font License 1.1
Copyright (c) 2024, Rune Bjørnerås (https://github.com/rubjo)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Try

    ↑↓ selectEnter openTab filter

    Settings

    Theme
    Text
    Print

    Keyboard shortcuts

    / or Ctrl KSearch
    ↑ ↓ EnterPick a result
    TabNext result filter
    j kNext or previous entry
    [ ]Previous or next page
    yCopy a link to the current entry
    ?These shortcuts
    EscClose

    On this page