Termbox::Event - A Single User Interaction
This class represents an incoming event from the tty.
Given the event type, the following fields are relevant:
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_*.
TB_MOD_CTRL
TB_KEY_CTRL_*
TB_MOD_SHIFT
TB_KEY_ARROW_*
TB_EVENT_RESIZE
w, h
TB_EVENT_MOUSE
key (TB_KEY_MOUSE_*), x, y
TB_KEY_MOUSE_*
Events are loaded with a lot of data... user these methods to access it:
type( )
Returns one of TB_EVENT_* constants.
TB_EVENT_*
mod( )
Returns bitwise TB_MOD_* constants
TB_MOD_*
key( )
One of the TB_KEY_.+ constants imported from Termbox with the :key tag.
TB_KEY_.+
:key
ch( )
A single Unicode code point, if available.
w( )
Resize width.
h( )
Resize height
x( )
Mouse x.
y( )
Mouse y.
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.
Sanko Robinson <sanko@cpan.org>
To install Termbox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Termbox
CPAN shell
perl -MCPAN -e shell install Termbox
For more information on module installation, please visit the detailed CPAN module installation guide.