summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-16 18:52:40 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-16 18:52:40 +0000
commit95b2e977d7a1bc453591b5a80746df785cbccda2 (patch)
tree43b9aa6b1784107d958723643049eba6e9b16832 /perl-install
parentfe17b4603993dba3b6f395137d54e5eb44bd7c3d (diff)
downloaddrakx-backup-do-not-use-95b2e977d7a1bc453591b5a80746df785cbccda2.tar
drakx-backup-do-not-use-95b2e977d7a1bc453591b5a80746df785cbccda2.tar.gz
drakx-backup-do-not-use-95b2e977d7a1bc453591b5a80746df785cbccda2.tar.bz2
drakx-backup-do-not-use-95b2e977d7a1bc453591b5a80746df785cbccda2.tar.xz
drakx-backup-do-not-use-95b2e977d7a1bc453591b5a80746df785cbccda2.zip
- prefer XKB available from existing XF86Config over /etc/sysconfig/keyboard KEYTABLE
- fix translating from /etc/sysconfig/keyboard KEYTABLE to XKB
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Xconfig.pm19
1 files changed, 9 insertions, 10 deletions
diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm
index 487b2b6fa..fb83ec654 100644
--- a/perl-install/Xconfig.pm
+++ b/perl-install/Xconfig.pm
@@ -7,17 +7,16 @@ use any;
use common;
use mouse;
use devices;
+use keyboard;
use Xconfigurator;
-# otherwise uses the rule substr($keymap, 0, 2)
-my %keymap_translate = (
- cf => "ca_enhanced",
- uk => "gb",
-);
-
-sub keymap_translate {
- $keymap_translate{$_[0]} || substr($_[0], 0, 2);
+sub keyboard_from_kmap {
+ my ($loadkey) = @_;
+ foreach (keyboard::keyboards()) {
+ keyboard::keyboard2kmap($_) eq $loadkey and return keyboard::keyboard2xkb($_);
+ }
+ '';
}
@@ -167,7 +166,7 @@ sub getinfoFromXF86Config {
delete $mouse{auxmouse} unless $mouse{auxmouse}{XMOUSETYPE}; #- only take care of a true mouse.
#- try to merge with $o, the previous has been obtained by ddcxinfos.
- add2hash($o->{keyboard} ||= {}, \%keyboard);
+ put_in_hash($o->{keyboard} ||= {}, \%keyboard);
add2hash($o->{mouse} ||= {}, \%mouse);
@{$o->{wacom} || []} > 0 or $o->{wacom} = [ keys %wacom ];
add2hash($o->{monitor} ||= {}, \%monitor);
@@ -182,7 +181,7 @@ sub getinfoFromSysconfig {
add2hash($o->{mouse} ||= {}, { getVarsFromSh("$prefix/etc/sysconfig/mouse") });
if (my %keyboard = getVarsFromSh "$prefix/etc/sysconfig/keyboard") {
- $o->{keyboard}{xkb_keymap} ||= keymap_translate($keyboard{KEYTABLE}) if $keyboard{KEYTABLE};
+ $o->{keyboard}{xkb_keymap} ||= keyboard_from_kmap($keyboard{KEYTABLE}) if $keyboard{KEYTABLE};
}
$o;
}