NAME

TUI::Gadgets::PrintConstants - helpers for printing symbolic event constants

SYNOPSIS

use TUI::Gadgets::PrintConstants qw(
  printKeyCode
  printControlKeyState
  printEventCode
  printMouseButtonState
  printMouseWheelState
  printMouseEventFlags
);

printKeyCode($out, $event->{keyDown}{keyCode});
printEventCode($out, $event->{what});

DESCRIPTION

TUI::Gadgets::PrintConstants provides helper functions for printing symbolic representations of TUI::Vision constants.

The functions translate numeric event, key, and mouse codes into their corresponding symbolic names and write the result to a supplied output object. If a value cannot be mapped to a known constant, its numeric representation is printed instead.

This module is intended for debugging and diagnostic output and is commonly used by gadgets such as TEventViewer.

FUNCTIONS

All functions write their output to the provided output object and do not return a value.

printKeyCode

printKeyCode($out, $keyCode);

Prints the symbolic name of a keyboard key code.

printControlKeyState

printControlKeyState($out, $state);

Prints the symbolic names of the control key state flags.

Multiple flags are combined using |.

printEventCode

printEventCode($out, $eventCode);

Prints the symbolic name of an event code.

printMouseButtonState

printMouseButtonState($out, $state);

Prints the symbolic names of mouse button state flags.

printMouseWheelState

printMouseWheelState($out, $state);

Prints the symbolic names of mouse wheel state flags.

printMouseEventFlags

printMouseEventFlags($out, $flags);

Prints the symbolic names of mouse event flags.

SEE ALSO

TUI::Drivers::Const, TUI::Drivers::Event, TUI::Gadgets::EventViewer

AUTHORS

  • Borland International (original Turbo Vision design)

  • J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)

COPYRIGHT AND LICENSE

Copyright (c) 1990-1994, 1997 by Borland International

Copyright (c) 2026 the "AUTHORS" as listed above.

This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).