summaryrefslogtreecommitdiffstats
path: root/lib/mouse.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-11-19 16:53:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-11-19 16:53:13 +0000
commita7b271677cac573bea00ad9667f4503375604e8b (patch)
treeed64db79a5b7d4030485337977b3596becb28559 /lib/mouse.pm
parenta79ce06756b78066965f1a2c81b9a50c5d7657b6 (diff)
downloaddrakx-kbd-mouse-x11-a7b271677cac573bea00ad9667f4503375604e8b.tar
drakx-kbd-mouse-x11-a7b271677cac573bea00ad9667f4503375604e8b.tar.gz
drakx-kbd-mouse-x11-a7b271677cac573bea00ad9667f4503375604e8b.tar.bz2
drakx-kbd-mouse-x11-a7b271677cac573bea00ad9667f4503375604e8b.tar.xz
drakx-kbd-mouse-x11-a7b271677cac573bea00ad9667f4503375604e8b.zip
- use /dev/input/by-id/xxx device instead of vendor+product for evdev mice
(vendor+product support is dropped in x11-driver-input-evdev-1.2.0)
Diffstat (limited to 'lib/mouse.pm')
-rw-r--r--lib/mouse.pm31
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/mouse.pm b/lib/mouse.pm
index 1c776ba..8df14c1 100644
--- a/lib/mouse.pm
+++ b/lib/mouse.pm
@@ -242,22 +242,26 @@ sub write {
}
}
+sub input_entry_to_device_by_id {
+ my ($input) = @_;
+
+ my $ID_SERIAL = chomp_(run_program::get_stdout('/lib/udev/usb_id', $input->{sysfs_path}));
+ $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h
+ my $sysfs_device = "input/by-id/usb-$ID_SERIAL-event-mouse"; #- from /etc/udev/rules.d/60-persistent-input.rules
+ if ($::isInstall || -e "/dev/$sysfs_device") {
+ $sysfs_device;
+ } else {
+ log::l("$sysfs_device missing");
+ ();
+ }
+}
+
sub probe_usb_wacom_devices() {
detect_devices::hasWacom() or return;
eval { modules::load("wacom", "evdev") };
- map {
- my $ID_SERIAL = chomp_(run_program::get_stdout('/lib/udev/usb_id', $_->{sysfs_path}));
- $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h
- my $sysfs_device = "input/by-id/usb-$ID_SERIAL-event-mouse"; #- from /etc/udev/rules.d/60-persistent-input.rules
- if ($::isInstall || -e "/dev/$sysfs_device") {
- $sysfs_device;
- } else {
- log::l("$sysfs_device missing");
- ();
- }
- } detect_devices::usbWacom();
+ map { input_entry_to_device_by_id($_) } detect_devices::usbWacom();
}
sub detect_serial() {
@@ -293,9 +297,8 @@ sub mice2evdev {
#- we always use HWheelRelativeAxisButtons for evdev, it tells mice with no horizontal wheel to skip those buttons
#- that way we ensure 6 & 7 is always horizontal wheel
#- (cf patch skip-HWheelRelativeAxisButtons-even-if-unused in x11-driver-input-evdev)
- { bustype => "0x$_->{bustype}", vendor => "0x$_->{vendor}", product => "0x$_->{id}",
- relBits => "+0+1+2", HWheelRelativeAxisButtons => "7 6" };
- } @mice ]
+ { device => "/dev/$_", HWheelRelativeAxisButtons => "7 6" };
+ } map { input_entry_to_device_by_id($_) } @mice ];
}
sub detect_evdev_mice {