summaryrefslogtreecommitdiffstats
path: root/perl-install/keyboard.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-02 02:46:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-02 02:46:14 +0000
commiteba9c3257866392f91132c338fbe59a4b01fa119 (patch)
treed0127870b0210f687f4c456ea87e4f2c50eea0dc /perl-install/keyboard.pm
parentc7f7e91919ee72b885d5b3253c608393279945ae (diff)
downloaddrakx-backup-do-not-use-eba9c3257866392f91132c338fbe59a4b01fa119.tar
drakx-backup-do-not-use-eba9c3257866392f91132c338fbe59a4b01fa119.tar.gz
drakx-backup-do-not-use-eba9c3257866392f91132c338fbe59a4b01fa119.tar.bz2
drakx-backup-do-not-use-eba9c3257866392f91132c338fbe59a4b01fa119.tar.xz
drakx-backup-do-not-use-eba9c3257866392f91132c338fbe59a4b01fa119.zip
- create keyboard::default() and use it
- it uses keyboard::from_DMI() to get XkbModel when possible
Diffstat (limited to 'perl-install/keyboard.pm')
-rw-r--r--perl-install/keyboard.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 5332a62fa..ee95f8e8c 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -456,6 +456,14 @@ sub lang2keyboard {
{ KEYBOARD => $keyboards{$kb} ? $kb : 'us' }; #- handle incorrect keyboard mapping to us.
}
+sub default {
+ my ($o_locale) = @_;
+
+ my $keyboard = from_usb() || lang2keyboard(($o_locale || lang::read())->{lang});
+ add2hash($keyboard, from_DMI());
+ $keyboard;
+}
+
sub from_usb() {
return if $::noauto;
my ($usb_kbd) = detect_devices::usbKeyboards() or return;
@@ -464,6 +472,11 @@ sub from_usb() {
$keyboard !~ /SKIP/ && { KEYBOARD => $keyboard };
}
+sub from_DMI() {
+ my $XkbModel = detect_devices::probe_unique_name('XkbModel');
+ $XkbModel && { XkbModel => $XkbModel };
+}
+
sub load {
my ($keymap) = @_;
return if $::testing;