Skip to content

Modern Tui TuiKey HasMod

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

Home › Terminal TUI Library › Events › TuiKey.HasMod

TuiKey.HasMod

Returns true if the given modifier, Shift, Alt or Ctrl, was held.

Syntax

TuiKey.HasMod( byval m as TuiMod ) as boolean

Description

Tests one modifier bit: TUIMOD_SHIFT, TUIMOD_ALT or TUIMOD_CTRL. Also a bare boolean -- see IsChar.

Example

#import "std/tui"
using tui

dim as TuiKey k
k.code = TUIKEY_LEFT
k.mods = TUIMOD_CTRL or TUIMOD_SHIFT
print k.HasMod( TUIMOD_CTRL )     '' true
print k.HasMod( TUIMOD_ALT )      '' false
print TuiKeyName( k )             '' Ctrl+Shift+Left

See also

TuiEvent TuiKey.IsChar 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