Curses::UI::Mousehandler::GPM - Curses::UI GPM Bindings
use Curses::UI::Mousehandler::GPM; if (gpm_enable) { print "Succesfully enabled GPM mouse events\n"; } else { print "Couldn't enable GPM mouse events\n"; } while (1) { my $MEVENT = gpm_get_mouse_event(); if ($MEVENT) { my ($id, $x, $y, $z, $bstate) = unpack("sx2i3l", $MEVENT); my %MEVENT = ( -id => $id, -x => $x, -y => $y, -bstate => $bstate ); print "Got mouse event at $x,$y\n"; } }
You will need curses.h (from a curses-devel package) and gpm.h (from a gpm-devel or libgpm-devel package) in order to compile. Libgpm is needed to bind against it. A running GPM is not really needed but might be usefull :-).
Curses::UI::Mousehandler::GPM is a module to allow GPM style mouse events in Curses::UI.
Tries to connect to GPM. Returns a true value on success, false otherwise.
Selects for a mouse event in the GPM queue and returns it in an ncurses compatible MEVENT struct. If no mouse event is found undef will be returned. The call is non blocking.
ncurses(3NCURSES) gpm(8)
Marcus Thiesen, <marcus@thiesen.org<gt>
Copyright (C) 2004 by Marcus Thiesen
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.
To install Curses::UI::Mousehandler::GPM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Curses::UI::Mousehandler::GPM
CPAN shell
perl -MCPAN -e shell install Curses::UI::Mousehandler::GPM
For more information on module installation, please visit the detailed CPAN module installation guide.