Curses::UI::Mousehandler::GPM - Curses::UI GPM Bindings


Curses-UI-Mousehandler-GPM documentation  | view source Contained in the Curses-UI-Mousehandler-GPM distribution.

Index


NAME

Top

Curses::UI::Mousehandler::GPM - Curses::UI GPM Bindings

SYNOPSIS

Top

  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";
    }
  }

REQUIREMENTS

Top

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 :-).

DESCRIPTION

Top

Curses::UI::Mousehandler::GPM is a module to allow GPM style mouse events in Curses::UI.

EXPORT

Top

gpm_enable

Tries to connect to GPM. Returns a true value on success, false otherwise.

gpm_get_mouse_event

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.

SEE ALSO

Top

ncurses(3NCURSES) gpm(8)

AUTHOR

Top

Marcus Thiesen, <marcus@thiesen.org<gt>

COPYRIGHT AND LICENSE

Top


Curses-UI-Mousehandler-GPM documentation  | view source Contained in the Curses-UI-Mousehandler-GPM distribution.