| Linux-Input-Info documentation | view source | Contained in the Linux-Input-Info distribution. |
Linux::Input::Info - get information about /dev/input/event* devices under Linux
use Linux::Input::Info qw(:all); # optionally export EV_* constants
for (0..32) {
my $i = Linux::Input::Info->new($_);
printf "/dev/input/event%d\n", $_;
printf "\tbustype : %s\n", $i->bustype;
printf "\tvendor : 0x%x\n", $i->vendor;
printf "\tproduct : 0x%x\n", $i->product;
printf "\tversion : %d\n", $i->version;
printf "\tname : %s\n", $i->name;
printf "\tuniq : %s\n", $i->uniq;
printf "\tphys : %s\n", $i->phys;
printf "\tbits ev :";
printf " %s", $i->ev_name($_) for $i->bits;
printf "\n";
}
Returns undef if the device does not exist.
get the bus type
get vendor id
get the product id
get driver version
get device name
get unique identifier
get physical location
get event bits
map event bit to event name
Make sure it doesn't leak memory.
Simon Wistow <simon@thegestalt.org>
Copyright 2005, Simon Wistow
Gerd Knorr's input utils - http://dl.bytesex.org/cvs-snapshots/
| Linux-Input-Info documentation | view source | Contained in the Linux-Input-Info distribution. |