summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-12-18 14:27:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-12-18 14:27:13 +0000
commit8ca860266ac5204d738cb5d87fcf055f86787ec0 (patch)
treed17b4bd1a9cfae352521700c30958ffece729973 /lib
parent7e9d87c3d822dcbd12408b311e812ebe7fbddcc5 (diff)
downloaddrakx-kbd-mouse-x11-8ca860266ac5204d738cb5d87fcf055f86787ec0.tar
drakx-kbd-mouse-x11-8ca860266ac5204d738cb5d87fcf055f86787ec0.tar.gz
drakx-kbd-mouse-x11-8ca860266ac5204d738cb5d87fcf055f86787ec0.tar.bz2
drakx-kbd-mouse-x11-8ca860266ac5204d738cb5d87fcf055f86787ec0.tar.xz
drakx-kbd-mouse-x11-8ca860266ac5204d738cb5d87fcf055f86787ec0.zip
- keyboarddrake:
o correctly handle default XkbModel (so that we do not force pc105 when we should not) (nb: this is not very important nowadays because XkbModel is deprecated with evdev, but hell, it's easy to fix :)
Diffstat (limited to 'lib')
-rw-r--r--lib/keyboard.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/keyboard.pm b/lib/keyboard.pm
index a3c7f15..8d9460f 100644
--- a/lib/keyboard.pm
+++ b/lib/keyboard.pm
@@ -523,6 +523,16 @@ sub parse_xkb_rules() {
\%l;
}
+sub default_XkbModel {
+ my ($keyboard) = @_;
+
+ my $Layout = keyboard2xkb($keyboard);
+
+ (arch() =~ /sparc/ ? 'sun' :
+ $Layout eq 'jp' ? 'jp106' :
+ $Layout eq 'br' ? 'abnt2' : 'pc105');
+}
+
sub keyboard2full_xkb {
my ($keyboard) = @_;
@@ -531,10 +541,7 @@ sub keyboard2full_xkb {
$Layout = join(',', 'us', $Layout);
}
- my $Model = $keyboard->{XkbModel} ||
- (arch() =~ /sparc/ ? 'sun' :
- $Layout eq 'jp' ? 'jp106' :
- $Layout eq 'br' ? 'abnt2' : 'pc105');
+ my $Model = $keyboard->{XkbModel} || default_XkbModel($keyboard);
my $Options = join(',',
if_($keyboard->{GRP_TOGGLE}, "grp:$keyboard->{GRP_TOGGLE}", 'grp_led:scroll'),