diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-02-06 17:20:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-02-06 17:20:07 +0000 |
commit | 2746a6460465e06de266196f4e090ab2d327743c (patch) | |
tree | aae500df9c6ce97e630ff9af6a6f9f26ed9f2689 /perl-install | |
parent | c9b206a2fb2eee28e56d12fa0c2ca3f9ea9a7d75 (diff) | |
download | drakx-2746a6460465e06de266196f4e090ab2d327743c.tar drakx-2746a6460465e06de266196f4e090ab2d327743c.tar.gz drakx-2746a6460465e06de266196f4e090ab2d327743c.tar.bz2 drakx-2746a6460465e06de266196f4e090ab2d327743c.tar.xz drakx-2746a6460465e06de266196f4e090ab2d327743c.zip |
- add change_mouse_live()
- use /dev/mouse in XF86Config to allow changing protocol in standalone
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/mouse.pm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index d29fc5394..ed166a48f 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -347,7 +347,7 @@ sub set_xfree_conf { my @mice = map { { Protocol => $_->{XMOUSETYPE}, - Device => "/dev/$_->{device}", + Device => "/dev/mouse", if_($_->{nbuttons} > 3, ZAxisMapping => [ $_->{nbuttons} > 5 ? '6 7' : '4 5' ]), if_($_->{nbuttons} < 3, Emulate3Buttons => undef, Emulate3Timeout => 50), if_($_->{EMULATEWHEEL}, Emulate3Buttons => undef, Emulate3Timeout => 50, EmulateWheel => undef, EmulateWheelButton => 2), @@ -412,6 +412,23 @@ sub write_conf { $xfree_conf->write; } +sub change_mouse_live { + my ($mouse, $old) = @_; + + my $xId = xmouse2xId($mouse->{XMOUSETYPE}); + $old->{device} ne $mouse->{device} || $xId != xmouse2xId($old->{XMOUSETYPE}) or return; + + log::l("telling X server to use another mouse ($mouse->{XMOUSETYPE}, $xId)"); + eval { modules::load('serial') } if $mouse->{device} =~ /ttyS/; + + if (!$::testing) { + devices::make($mouse->{device}); + symlinkf($mouse->{device}, "/dev/mouse"); + c::setMouseLive($ENV{DISPLAY}, $xId, $mouse->{nbuttons} < 3); + } + 1; +} + sub test_mouse_install { my ($mouse, $x_protocol_changed) = @_; require ugtk2; |