summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-09-28 15:21:48 +0000
committerOlivier Blin <oblin@mandriva.com>2007-09-28 15:21:48 +0000
commite73922b5b019a5415f56cc4f3f504f4f35874bad (patch)
tree88cfcd3e4c1e97d6b1b9040dd4ab0567b82ce6ce /lib
parent03580c07c5a712562e05bd5cd948acdc9dbc041d (diff)
downloaddrakx-kbd-mouse-x11-e73922b5b019a5415f56cc4f3f504f4f35874bad.tar
drakx-kbd-mouse-x11-e73922b5b019a5415f56cc4f3f504f4f35874bad.tar.gz
drakx-kbd-mouse-x11-e73922b5b019a5415f56cc4f3f504f4f35874bad.tar.bz2
drakx-kbd-mouse-x11-e73922b5b019a5415f56cc4f3f504f4f35874bad.tar.xz
drakx-kbd-mouse-x11-e73922b5b019a5415f56cc4f3f504f4f35874bad.zip
add support for x11-driver-input-vboxmouse when inside a VirtualBox guest
Diffstat (limited to 'lib')
-rw-r--r--lib/Xconfig/xfree.pm4
-rw-r--r--lib/mouse.pm8
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/Xconfig/xfree.pm b/lib/Xconfig/xfree.pm
index 6cf6df7..ab9d3b5 100644
--- a/lib/Xconfig/xfree.pm
+++ b/lib/Xconfig/xfree.pm
@@ -145,7 +145,7 @@ sub get_mice {
}
sub set_mice {
my ($raw_X, @mice) = @_;
- my @raw_mice = _new_mouse_sections($raw_X, map { $_->{Protocol} ? 'mouse' : 'evdev' } @mice);
+ my @raw_mice = _new_mouse_sections($raw_X, map { delete $_->{Driver} || ($_->{Protocol} ? 'mouse' : 'evdev') } @mice);
mapn {
my ($raw_mouse, $mouse) = @_;
raw_import_section($raw_mouse, $mouse);
@@ -155,7 +155,7 @@ sub set_mice {
sub _is_mouse {
my ($entry) = @_;
my $Driver = val($entry->{Driver});
- $Driver eq 'mouse' || $Driver eq 'evdev' && !val($entry->{XkbLayout});
+ member($Driver, 'mouse', 'vboxmouse') || $Driver eq 'evdev' && !val($entry->{XkbLayout});
}
sub _new_mouse_sections {
my ($raw_X, @Drivers) = @_;
diff --git a/lib/mouse.pm b/lib/mouse.pm
index a5c2ee1..8440ddd 100644
--- a/lib/mouse.pm
+++ b/lib/mouse.pm
@@ -85,6 +85,7 @@ sub all_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") ]),
+ if_(detect_devices::is_virtualbox(), [ 7, 'ps/2', 'vboxmouse', N_("VirtualBox mouse") ]),
] ],
N_("none") =>
@@ -337,7 +338,9 @@ sub detect {
my @wacom = probe_usb_wacom_devices();
$modules_conf->get_probeall("usb-interface") and eval { modules::load('usbhid') };
- if (my @mice = grep { $_->{Handlers}{mouse} } detect_devices::getInputDevices_and_usb()) {
+ if (detect_devices::is_virtualbox()) {
+ fullname2mouse("Universal|VirtualBox mouse");
+ } elsif (my @mice = grep { $_->{Handlers}{mouse} } detect_devices::getInputDevices_and_usb()) {
my @synaptics = map {
{ ALPS => $_->{ALPS} };
} grep { $_->{Synaptics} || $_->{ALPS} } @mice;
@@ -391,7 +394,7 @@ sub set_xfree_conf {
my @mice = map {
{
- Protocol => $_->{Protocol},
+ ($_->{Protocol} eq 'vboxmouse' ? "Driver" : "Protocol") => $_->{Protocol},
Device => "/dev/mouse",
if_($_->{Emulate3Buttons} || $_->{EmulateWheel}, Emulate3Buttons => undef, Emulate3Timeout => 50),
if_($_->{EmulateWheel}, EmulateWheel => undef, EmulateWheelButton => 2),
@@ -436,6 +439,7 @@ sub various_xfree_conf {
my @pkgs = (
if_($mouse->{synaptics}, 'synaptics'),
if_($mouse->{evdev_mice}, 'x11-driver-input-evdev'),
+ if_($mouse->{Protocol} eq 'vboxmouse', 'x11-driver-input-vboxmouse'),
if_($mouse->{imwheel}, 'imwheel'),
if_(@{$mouse->{wacom}}, 'linuxwacom'),
);