From 75f10e1d115428b94fb845e93bb001c3b48f10c6 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 3 Jun 2005 04:43:02 +0000 Subject: reformat keyboard2full_xkb() --- perl-install/keyboard.pm | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm index b70da0746..f01433a04 100644 --- a/perl-install/keyboard.pm +++ b/perl-install/keyboard.pm @@ -524,25 +524,22 @@ sub parse_xkb_rules() { sub keyboard2full_xkb { my ($keyboard) = @_; - my $XkbLayout = keyboard2xkb($keyboard) or return { XkbDisable => '' }; + my $Layout = keyboard2xkb($keyboard) or return { XkbDisable => '' }; + if ($keyboard->{GRP_TOGGLE} && $Layout !~ /,/) { + $Layout = join(',', 'us', $Layout); + } - my $XkbModel = $keyboard->{XkbModel} || + my $Model = $keyboard->{XkbModel} || (arch() =~ /sparc/ ? 'sun' : - $XkbLayout eq 'jp' ? 'jp106' : - $XkbLayout eq 'br' ? 'abnt2' : 'pc105'); - - { - XkbLayout => - $XkbLayout =~ /,/ ? $XkbLayout : - join(',', if_($keyboard->{GRP_TOGGLE}, 'us'), $XkbLayout), - XkbModel => $XkbModel, - XkbOptions => join(',', - if_($keyboard->{GRP_TOGGLE}, - "grp:$keyboard->{GRP_TOGGLE}", - 'grp_led:scroll'), - if_($keyboard->{GRP_TOGGLE} ne 'rwin_toggle', 'compose:rwin'), - ), - }; + $Layout eq 'jp' ? 'jp106' : + $Layout eq 'br' ? 'abnt2' : 'pc105'); + + my $Options = join(',', + if_($keyboard->{GRP_TOGGLE}, "grp:$keyboard->{GRP_TOGGLE}", 'grp_led:scroll'), + if_($keyboard->{GRP_TOGGLE} ne 'rwin_toggle', 'compose:rwin'), + ); + + { XkbModel => $Model, XkbLayout => $Layout, XkbOptions => $Options }; } sub xmodmap_file { -- cgit v1.2.1