TCOD::Mouse - A representation of a mouse event
use TCOD; my $key = TCOD::Key->new; my $mouse = TCOD::Mouse->new; TCOD::Sys::check_for_event( TCOD::EVENT_ANY, $key, $mouse ); exit if $mouse->mbutton_pressed;
This represents a TCOD mouse event. You will not normally be populating these objects. Most often you will create one, and pass it to one of the event listeners for it to be populated internally.
In effect, this is a read-only class.
The horizontal coordinate of the mouse cursor in pixels.
The vertical coordinate of the mouse cursor in pixels.
The change in pixels in the horizontal coordinate of the mouse cursor.
The change in pixels in the vertical coordinate of the mouse cursor.
The horizontal coordinate of the mouse cursor in cells.
The vertical coordinate of the mouse cursor in cells.
The change in cells in the horizontal coordinate of the mouse cursor.
The change in cells in the vertical coordinate of the mouse cursor.
True if the left mouse button is pressed.
True if the right mouse button is pressed.
True if the middle mouse button or wheel is pressed.
True if the left mouse button was pressed and released.
True if the right mouse button was pressed and released.
True if the middle mouse button or wheel was pressed and released.
True if the wheel was rolled up.
True if the wheel was rolled down.
TCOD::Mouse::show_cursor( $bool );
By default, the mouse cursor in visible in windowed mode, hidden in fullscreen mode. You can change it with this function.
$bool = TCOD::Mouse::is_cursor_visible;
Get the current status of the mouse cursor (visible or hidden).
TCOD::Mouse::move( $x, $y );
Set the cursor position (in pixel coordinates, where (0,0) is the top-left corner).
Copyright 2021 José Joaquín Atria
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
To install TCOD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TCOD
CPAN shell
perl -MCPAN -e shell install TCOD
For more information on module installation, please visit the detailed CPAN module installation guide.