diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-07 10:40:19 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-07 10:40:19 +0000 |
commit | 2b499eb8f4a08f4a497ec14002ba19b2e6ba4195 (patch) | |
tree | b30201e45fbfd467438b93604a0fe7a0b77a2c96 /lib/mouse.pm | |
parent | b6976efddcc4b22ff1684ff61a5e9e7fee4f37e4 (diff) | |
download | drakx-kbd-mouse-x11-2b499eb8f4a08f4a497ec14002ba19b2e6ba4195.tar drakx-kbd-mouse-x11-2b499eb8f4a08f4a497ec14002ba19b2e6ba4195.tar.gz drakx-kbd-mouse-x11-2b499eb8f4a08f4a497ec14002ba19b2e6ba4195.tar.bz2 drakx-kbd-mouse-x11-2b499eb8f4a08f4a497ec14002ba19b2e6ba4195.tar.xz drakx-kbd-mouse-x11-2b499eb8f4a08f4a497ec14002ba19b2e6ba4195.zip |
- minimal support for allowing to choose evdev on all mice
Diffstat (limited to 'lib/mouse.pm')
-rw-r--r-- | lib/mouse.pm | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/mouse.pm b/lib/mouse.pm index 5ba847d..f57ddad 100644 --- a/lib/mouse.pm +++ b/lib/mouse.pm @@ -83,6 +83,7 @@ my %mice = N_("Universal") => [ [ 'input/mice' ], [ [ 7, 'ps/2', 'ExplorerPS/2', N_("Any PS/2 & USB mice") ], + [ 7, 'ps/2', 'ExplorerPS/2', N_("Force evdev") ], #- evdev is magically handled in mouse::select() if_(detect_devices::is_xbox(), [ 5, 'ps/2', 'IMPS/2', N_("Microsoft Xbox Controller S") ]), ] ], @@ -281,6 +282,17 @@ sub detect_serial() { $mouse, @wacom; } +sub mice2evdev { + my (@mice) = @_; + + [ map { + #- 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) + { vendor => "0x$_->{vendor}", product => "0x$_->{id}", HWheelRelativeAxisButtons => "7 6" }; + } @mice ] +} + sub detect_evdev_mice { my (@mice) = @_; @@ -300,18 +312,15 @@ sub detect_evdev_mice { $imwheel ||= 'generic'; } } - - my @evdev_mice = map { - #- 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) - { vendor => "0x$_->{vendor}", product => "0x$_->{id}", HWheelRelativeAxisButtons => "7 6" }; - } grep { $_->{want_evdev} } @mice; + + my @evdev_mice = grep { $_->{want_evdev} } @mice; log::l("configuring mice with imwheel for thumb buttons (imwheel=$imwheel)") if $imwheel; log::l("configuring mice for evdev (" . join(' ', map { "$_->{vendor}:$_->{product}" } @evdev_mice) . ")") if @evdev_mice; - { imwheel => $imwheel, if_(@evdev_mice, evdev_mice => \@evdev_mice) }; + { imwheel => $imwheel, + evdev_mice_all => mice2evdev(@mice), + if_(@evdev_mice, evdev_mice => mice2evdev(@evdev_mice)) }; } sub detect { @@ -528,6 +537,9 @@ sub select { if ($fullname ne $prev) { my $mouse_ = fullname2mouse($fullname, device => $mouse->{device}); + if ($fullname =~ /evdev/) { + $mouse_->{evdev_mice} = $mouse_->{evdev_mice_all} = $mouse->{evdev_mice_all}; + } %$mouse = %$mouse_; } |