input.keyboard · function ·

ConsumeKeyPress

Consumes one non-repeated key-down edge. This remains true across a short down/up tap until the caller observes it, then returns false until the next physical press.

cpufunctioninputinput.keyboardkeyboardsource-exampleyeho

Poll named keys for the active application window.

external ConsumeKeyPress(text key) -> bool

Status: source-declared

Parameters

text key
Supply key as text.

Use ConsumeKeyPress

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

cpu · source-example · type checked

using input.keyboard

// Poll named keys for the active application window.
text key = "key"
bool result = ConsumeKeyPress(key)
Console.Log(Text.From(result))
project.mech
manifestVersion = "2"
package = "api.example.input_keyboard__consumekeypress"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "input.keyboard"
version = "0.1.0"
path = "../../../yeho/packages/input/keyboard"
Notes and source

Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

yeho/packages/input/keyboard/keyboard.yh:9