The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Termbox::Event - A Single User Interaction

SYNOPSIS

Description

This class represents an incoming event from the tty.

Given the event type, the following fields are relevant:

when TB_EVENT_KEY

(key XOR ch, one will be zero), mod. Note there is overlap between TB_MOD_CTRL and TB_KEY_CTRL_*. TB_MOD_CTRL and TB_MOD_SHIFT are only set as modifiers to TB_KEY_ARROW_*.

when TB_EVENT_RESIZE

w, h

when TB_EVENT_MOUSE

key (TB_KEY_MOUSE_*), x, y

Methods

Events are loaded with a lot of data... user these methods to access it:

type( )

Returns one of TB_EVENT_* constants.

mod( )

Returns bitwise TB_MOD_* constants

key( )

One of the TB_KEY_.+ constants imported from Termbox with the :key tag.

ch( )

A single Unicode code point, if available.

w( )

Resize width.

h( )

Resize height

x( )

Mouse x.

y( )

Mouse y.

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.

AUTHOR

Sanko Robinson <sanko@cpan.org>