Skip to content

Modern Tui TuiKey IsChar

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Events › TuiKey.IsChar

TuiKey.IsChar

Returns true if the key is a typed character rather than a named key.

Syntax

TuiKey.IsChar( ) as boolean

Description

True when this is a printable character rather than a named key -- that is, when ch is worth reading. It returns a BARE BOOLEAN, so mixing it with a comparison in one ANDALSO chain is warning 38; hoist to a boolean local.

Example

#import "std/tui"
using tui

dim as TuiKey k
k.code = TUIKEY_CHAR : k.ch = asc( "q" )
print k.IsChar( )                 '' true

'' the correct shape -- warning 38 is only visible at -w all
dim as boolean wasChar = k.IsChar( )
dim as boolean isQ = ( k.ch = asc( "q" ) )
if( wasChar andalso isQ ) then print "quit"

See also

TuiEvent TuiKey.HasMod TuiKeyName TuiInput.Feed TuiInput.PushEvent TuiInput.Buffered
TuiKey TuiMouse TuiInput TuiInput.NextEvent TuiInput.Reset TuiInput.Queued

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Events
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally