|
Curses::UI::Mousehandler::GPM - Curses::UI GPM Bindings |
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.
ncurses(3NCURSES) gpm(8)
Marcus Thiesen, <marcus@thiesen.org
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.
|
Curses::UI::Mousehandler::GPM - Curses::UI GPM Bindings |