DatumHueEnterprise v0.0.24datumhue.com
Contents

namespaceDebug Input10 functions

datumhue.debug.input

Synthetic keyboard, pointer, touch and gamepad input for development: injected keys, buttons, wheel turns, touches and pad input reach the input state from the next frame on, as real input arriving between frames does, and focus and every input read treat them as real input -- except the widgets that act outside the app (file-access and copy buttons, links, and a workstation dialog's buttons that open a web page or quit the workstation, such as the quit confirmation's Quit), which ignore synthetic input. Available when running from local source; a packed archive run needs the run command's opt-in flag, and other launch modes never allow it.

Functions 10

datumhue.debug.input.key

function
datumhue.debug.input.key(key: input.Key, down: boolean)

Press (down = true) or release a key, as a keyboard does: from the next frame on the input readers, input.on_key and the focused widget see it, so every callback run in that frame sees the press or release once; the run that made the call does not. The key stays held until released. Pressing a held key or releasing one that is up does nothing. A side-agnostic modifier name presses its left key.

Example
datumhue.debug.input.key("shift_left", true)
-- Input reaches the readers from the next frame on.
datumhue.time.wait_frames(1)
print(datumhue.input.is_key_down("shift_left")) --> true
-- It stays held until released.
datumhue.debug.input.key("shift_left", false)

datumhue.debug.input.tap

function
datumhue.debug.input.tap(key: input.Key)

Press a key and release it shortly after: one clean press-release to every consumer, the press from the next frame on, as key delivers it. A side-agnostic modifier name taps its left key.

datumhue.debug.input.cursor

function
datumhue.debug.input.cursor(x: number, y: number)

Move the pointer to a position in UI px from the top-left of the calling app's content area, the frame input.app_mouse_position and UiElement.bounds use, so bounds.center points at the element at every zoom and stretch mode. While the caller's content area is not laid out (always, in a service app), from the top-left of the bootstrap's.

Example
-- UI px from the top-left of this app's content area.
datumhue.debug.input.cursor(100, 50)
datumhue.time.wait_frames(1)
print(datumhue.input.app_mouse_position()) --> vec2(100.0, 50.0)

datumhue.debug.input.click

function
datumhue.debug.input.click(button?: input.MouseButton)

Press a mouse button at the current pointer position and release it shortly after, as tap does a key: the press reaches the readers from the next frame on. Defaults to the left button.

datumhue.debug.input.touch

function
datumhue.debug.input.touch(id: integer, x: number, y: number, down: boolean)

Set a touch point's state at a position in UI px from the top-left of the calling app's content area, the frame cursor takes: down = true starts the touch with this id, or moves it when already down; down = false ends it (a no-op when not down). The input readers see it from the next frame on, as they see a real touch.

Example
-- Touch 1 goes down at (120, 80), moves, then lifts.
datumhue.debug.input.touch(1, 120, 80, true)
datumhue.time.wait_frames(1)
datumhue.debug.input.touch(1, 140, 80, true)
datumhue.time.wait_frames(1)
print(datumhue.input.app_touch_position(1)) --> vec2(140.0, 80.0)
datumhue.debug.input.touch(1, 140, 80, false)

datumhue.debug.input.mouse_button

function
datumhue.debug.input.mouse_button(button: input.MouseButton, down: boolean)

Press (down = true) or release a mouse button at the current pointer position, reaching the readers from the next frame on, as key does. The button stays held until released, so cursor moves in between drag it, as a real mouse does. Pressing a held button or releasing one that is up does nothing.

datumhue.debug.input.wheel

function
datumhue.debug.input.wheel(dx: number, dy: number, unit?: debug.input.WheelUnit)

Turn the mouse wheel once at the current pointer position: one wheel event, which the scroll containers under the pointer take. input.scroll_delta reads it in the device's units, as it reads a real one: lines, or for pixel physical px, the UI px times the scale factor screen.resolution reports and screen.zoom. Positive dy is the wheel turned away from the user, which scrolls toward the top; positive dx scrolls toward the left. unit defaults to lines. Raises for a delta that is not a finite number.

Example
-- Three lines away from the user: content scrolls toward its top.
datumhue.debug.input.wheel(0, 3, "line")
datumhue.time.wait_frames(1)
print(datumhue.input.scroll_delta()) --> vec2(0.0, 3.0)

datumhue.debug.input.gamepad

function
datumhue.debug.input.gamepad(button: input.GamepadButton, down: boolean, pad_id?: integer)

Press (down = true) or release a button on the debug pad, a virtual gamepad the first pad call connects, named "debug pad". From the next frame on, the gamepad readers, input.last_source, focus navigation and window-manager grabs see it as a connected pad, listed by input.gamepads. The button stays as set until a later call changes it. The debug pad has no motors, so input.rumble on it does nothing. pad_id picks a debug pad by the id input.gamepads reports; without it, the first debug pad. Raises when pad_id is not a debug pad.

datumhue.debug.input.gamepad_stick

function
datumhue.debug.input.gamepad_stick(side: input.StickSide, value: Vec2, pad_id?: integer)

Set a stick on the debug pad (connecting it, as debug.input.gamepad does) to a position with each axis within -1..1, y up: the vector input.stick reads from the next frame on. The stick stays there until a later call moves it. pad_id picks the debug pad as debug.input.gamepad does. Raises for an axis outside -1..1.

Example
-- Each axis is within -1..1, y up: the left stick pushed forward.
datumhue.debug.input.gamepad_stick("left", datumhue.math.vec2(0, 1))
datumhue.time.wait_frames(1)
local pad = datumhue.input.gamepads()[1]
print(datumhue.input.stick(pad, "left")) --> vec2(0.0, 1.0)
-- It stays there until moved.
datumhue.debug.input.gamepad_stick("left", datumhue.math.vec2(0, 0))

datumhue.debug.input.gamepad_trigger

function
datumhue.debug.input.gamepad_trigger(side: input.StickSide, value: number, pad_id?: integer)

Set an analog trigger on the debug pad (connecting it, as debug.input.gamepad does) to a travel within 0..1: the value input.trigger reads from the next frame on. The trigger stays there until a later call moves it. pad_id picks the debug pad as debug.input.gamepad does. Raises for a value outside 0..1.

Example
-- Travel is within 0..1: the right trigger pulled halfway.
datumhue.debug.input.gamepad_trigger("right", 0.5)
datumhue.time.wait_frames(1)
local pad = datumhue.input.gamepads()[1]
print(datumhue.input.trigger(pad, "right")) --> 0.5
datumhue.debug.input.gamepad_trigger("right", 0)

Types 1

debug.input.WheelUnit

enum
ValueDescription
"line"Wheel notches, as a notched mouse wheel reports them.
"pixel"UI px, as a trackpad reports them: a scroll container moves by exactly this much at every zoom.

Used by: datumhue.debug.input.wheel

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