summaryrefslogtreecommitdiffstats
path: root/lib/mouse.pm
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-09-22 14:01:24 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-09-22 14:01:24 +0000
commit09622e2cdb437f0ac8f8a931f372058f3ecd73f9 (patch)
treefd95581bfe7f55fbb6f5793df700b98cb114e1a3 /lib/mouse.pm
parent6f0bc63edf2d88b2ebc87e71d0cdc3a91705988a (diff)
downloaddrakx-kbd-mouse-x11-09622e2cdb437f0ac8f8a931f372058f3ecd73f9.tar
drakx-kbd-mouse-x11-09622e2cdb437f0ac8f8a931f372058f3ecd73f9.tar.gz
drakx-kbd-mouse-x11-09622e2cdb437f0ac8f8a931f372058f3ecd73f9.tar.bz2
drakx-kbd-mouse-x11-09622e2cdb437f0ac8f8a931f372058f3ecd73f9.tar.xz
drakx-kbd-mouse-x11-09622e2cdb437f0ac8f8a931f372058f3ecd73f9.zip
move functions closer to their place of use
Diffstat (limited to 'lib/mouse.pm')
-rw-r--r--lib/mouse.pm100
1 files changed, 50 insertions, 50 deletions
diff --git a/lib/mouse.pm b/lib/mouse.pm
index 8139618..f04b681 100644
--- a/lib/mouse.pm
+++ b/lib/mouse.pm
@@ -15,8 +15,6 @@ use modules;
use any;
use log;
-my @mouses_fields = qw(nbuttons MOUSETYPE Protocol name EmulateWheel);
-
sub _all_mice() {
arch() =~ /^sparc/ ?
(
@@ -117,39 +115,6 @@ sub _all_mice() {
#- E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=10ms
-sub _xmouse2xId {
- #- xmousetypes must be sorted as found in /usr/include/X11/extensions/xf86misc.h
- #- so that first mean "0", etc
- my @xmousetypes = (
- "Microsoft",
- "MouseSystems",
- "MMSeries",
- "Logitech",
- "BusMouse", #MouseMan,
- "Logitech",
- "PS/2",
- "MMHittab",
- "GlidePoint",
- "IntelliMouse",
- "ThinkingMouse",
- "IMPS/2",
- "ThinkingMousePS/2",
- "MouseManPlusPS/2",
- "GlidePointPS/2",
- "NetMousePS/2",
- "NetScrollPS/2",
- "SysMouse",
- "Auto",
- "AceCad",
- "ExplorerPS/2",
- "USB",
- );
- my ($id) = @_;
- $id = 'BusMouse' if $id eq 'MouseMan';
- $id = 'IMPS/2' if $id eq 'ExplorerPS/2' && $::isInstall;
- eval { find_index { $_ eq $id } @xmousetypes } || 0;
-}
-
my %mouse_btn_keymap = (
0 => "NONE",
67 => "F9",
@@ -169,6 +134,8 @@ my %mouse_btn_keymap = (
sub _ppc_one_button_keys() { keys %mouse_btn_keymap }
sub _ppc_one_button_key2text { $mouse_btn_keymap{$_[0]} }
+my @mouses_fields = qw(nbuttons MOUSETYPE Protocol name EmulateWheel);
+
sub _raw2mouse {
my ($type, $raw) = @_;
$raw or return;
@@ -177,21 +144,6 @@ sub _raw2mouse {
+{ %l, type => $type, if_($l{nbuttons} < 3, Emulate3Buttons => 1) };
}
-sub _fullnames() {
- map_each {
- my $type = $::a;
- grep { $_ } map {
- if ($_) {
- my $l = _raw2mouse($type, $_);
- "$type|$l->{name}";
- } else {
- $type .= "|[" . N("Other") . "]";
- '';
- }
- } @{$::b->[1]};
- } _all_mice();
-}
-
sub fullname2mouse {
my ($fname, %opts) = @_;
my ($type, @l) = split '\|', $fname;
@@ -478,6 +430,39 @@ sub write_conf {
};
}
+sub _xmouse2xId {
+ #- xmousetypes must be sorted as found in /usr/include/X11/extensions/xf86misc.h
+ #- so that first mean "0", etc
+ my @xmousetypes = (
+ "Microsoft",
+ "MouseSystems",
+ "MMSeries",
+ "Logitech",
+ "BusMouse", #MouseMan,
+ "Logitech",
+ "PS/2",
+ "MMHittab",
+ "GlidePoint",
+ "IntelliMouse",
+ "ThinkingMouse",
+ "IMPS/2",
+ "ThinkingMousePS/2",
+ "MouseManPlusPS/2",
+ "GlidePointPS/2",
+ "NetMousePS/2",
+ "NetScrollPS/2",
+ "SysMouse",
+ "Auto",
+ "AceCad",
+ "ExplorerPS/2",
+ "USB",
+ );
+ my ($id) = @_;
+ $id = 'BusMouse' if $id eq 'MouseMan';
+ $id = 'IMPS/2' if $id eq 'ExplorerPS/2' && $::isInstall;
+ eval { find_index { $_ eq $id } @xmousetypes } || 0;
+}
+
sub change_mouse_live {
my ($mouse, $old) = @_;
@@ -519,6 +504,21 @@ sub test_mouse_install {
$r;
}
+sub _fullnames() {
+ map_each {
+ my $type = $::a;
+ grep { $_ } map {
+ if ($_) {
+ my $l = _raw2mouse($type, $_);
+ "$type|$l->{name}";
+ } else {
+ $type .= "|[" . N("Other") . "]";
+ '';
+ }
+ } @{$::b->[1]};
+ } _all_mice();
+}
+
sub select {
my ($in, $mouse) = @_;