Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Linux::Input 1.02

    Download button

    No screenshots available
    Downloads: 376  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    John BEPPU | More programs
    Perl Artistic License / FREE
    January 25th, 2007, 10:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Linux::Input description

    Linux::Input is a Linux input event interface.

    Linux::Input is a Linux input event interface.

    SYNOPSIS

    Example: 1 joystick using event API

    my $js1 = Linux::Input->new('/dev/input/event3');
    while (1) {
    while (my @events = $js1->poll(0.01)) {
    foreach (@event) {
    }
    }
    }

    Example: 2 joysticks using joystick API (different event structure)

    my $js1 = Linux::Input::Joystick->new('/dev/input/js0');
    my $js2 = Linux::Input::Joystick->new('/dev/input/js1');
    my $selector = IO::Select->new();
    $selector->add($js1->fh);
    $selector->add($js2->fh);

    while (my $fh = $selector->can_read) {
    my @event;
    if ($fh == $js1->fh) {
    @event = $js1->poll()
    } elsif ($fh == $js2->fh) {
    @event = $js2->poll()
    }
    foreach (@event) {
    # work
    }
    }

    Example 3: monitor all input devices

    use File::Basename qw(basename);
    my @inputs = map { "/dev/input/" . basename($_) }
    ;

    my @dev;
    my $selector = IO::Select->new();
    foreach (@inputs) {
    my $device = Linux::Input->new($_);
    $selector->add($device->fh);
    push @dev, $device;
    }

    while (my $fh = $selector->can_read) {
    # work
    }

    Example 4: testing for events on the command line

    # information on what event queue belongs to what device
    cat /proc/bus/input/devices

    # verify that events are coming in
    sudo evtest.pl /dev/input/event*

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    input event | input event interface | Perl module | Linux::Input | input | event

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM