summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 89698fd99..40a1b8236 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -456,6 +456,7 @@ sub getTVcards() { probe_category('multimedia/tv') }
sub getInputDevices() {
my (@devices, $device);
+ my $event;
foreach (cat_('/proc/bus/input/devices')) {
if (/^I:/) {
$device = {};
@@ -515,6 +516,7 @@ sub getInputDevices() {
my @l = split(' ', $1);
$device->{driver} = $l[0]; #- keep it for compatibility
$device->{Handlers} = +{ map { (/^(.*?)\d*$/ ? $1 : $_, $_) } split(' ', $1) };
+ $event = $device->{Handlers}{event};
} elsif (/S: Sysfs=(.+)/) {
$device->{sysfs_path} = $1;
} elsif (/P: Phys=(.*)/) {
@@ -537,8 +539,11 @@ sub getInputDevices() {
#- KEY=30000 0 0 0 0 0 0 0 0 #=> BTN_LEFT BTN_RIGHT
#- KEY=70000 0 0 0 0 0 0 0 0 #=> BTN_LEFT BTN_RIGHT BTN_MIDDLE
#- KEY=1f0000 0 0 0 0 0 0 0 0 #=> BTN_LEFT BTN_RIGHT BTN_MIDDLE BTN_SIDE BTN_EXTRA
- my $KEY = hex($1);
- $device->{SIDE} = 1 if $KEY & (1 << 0x13);
+ if (! -f "/dev/input/$event") {
+ devices::make("/dev/input/$event");
+ }
+ my @KEYS = c::EVIocGBitKey("/dev/input/$event");
+ $device->{SIDE} = 1 if $KEYS[0] & (1 << 0x13);
} elsif (/^\s*$/) {
push @devices, $device if $device;