From ede533057612d4a01c554f449f047399c0226532 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 9 Apr 2001 13:35:19 +0000 Subject: handle XkbModel (especially for abnt2 (br)) --- perl-install/Xconfig.pm | 2 ++ perl-install/Xconfigurator.pm | 8 ++++++++ perl-install/Xconfigurator_consts.pm | 6 ------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm index 726651849..6e53f4069 100644 --- a/perl-install/Xconfig.pm +++ b/perl-install/Xconfig.pm @@ -50,6 +50,7 @@ sub getinfoFromXF86Config { $c{driver} = $1 if /^\s*Driver\s+"(.*?)"/; $c{id} = $1 if /^\s*Identifier\s+"[^\d"]*(\d*)"/; + $c{xkb_model} ||= $1 if /^\s*Option\s+"XkbModel"\s+"(.*?)"/; $c{xkb_keymap} ||= $1 if /^\s*Option\s+"XkbLayout"\s+"(.*?)"/; $c{XMOUSETYPE} ||= $1 if /^\s*Option\s+"Protocol"\s+"(.*?)"/; $c{device} ||= $1 if /^\s*Option\s+"Device"\s+"\/dev\/(.*?)"/; @@ -93,6 +94,7 @@ sub getinfoFromXF86Config { local *F; open F, "$prefix/etc/X11/XF86Config"; while () { if (/^Section "Keyboard"/ .. /^EndSection/) { + $keyboard{xkb_model} ||= $1 if /^\s*XkbModel\s+"(.*?)"/; $keyboard{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/; } elsif (/^Section "Pointer"/ .. /^EndSection/) { $mouse{XMOUSETYPE} ||= $1 if /^\s*Protocol\s+"(.*?)"/; diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index cc884e74b..3eb484031 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -836,6 +836,14 @@ sub write_XF86Config { print G qq( Option "XkbDisable"\n) unless $O->{xkb_keymap}; print F $keyboardsection_part3; print G $keyboardsection_part3_v4; + + $O->{xkb_model} ||= + arch() =~ /ppc/ ? 'macintosh' : + arch() =~ /sparc/ ? 'sun' : + $O->{xkb_keymap} eq 'br' ? 'abnt2' : 'pc105'; + print F qq( XkbModel "$O->{xkb_model}"\n); + print G qq( Option "XkbModel" "$O->{xkb_model}"\n); + print F qq( XkbLayout "$O->{xkb_keymap}"\n); print G qq( Option "XkbLayout" "$O->{xkb_keymap}"\n); print F join '', map { " $_\n" } @{$xkb_options{$O->{xkb_keymap}} || []}; diff --git a/perl-install/Xconfigurator_consts.pm b/perl-install/Xconfigurator_consts.pm index 9c6e67c5f..95e3f8020 100644 --- a/perl-install/Xconfigurator_consts.pm +++ b/perl-install/Xconfigurator_consts.pm @@ -487,7 +487,6 @@ if (arch() =~ /^sparc/) { # XkbSymbols "sun/us(sun5)" XkbRules "sun" - XkbModel "sun" XkbLayout "us" XkbCompat "compat/complete" XkbTypes "types/complete" @@ -497,7 +496,6 @@ if (arch() =~ /^sparc/) { '; $keyboardsection_part3_v4 = ' Option "XkbRules" "sun" - Option "XkbModel" "sun" Option "XkbLayout" "us" Option "XkbCompat" "compat/complete" Option "XkbTypes" "types/complete" @@ -538,12 +536,10 @@ $keyboardsection_part3 = ' XkbSymbols "macintosh/us" XkbGeometry "macintosh" XkbRules "xfree86" - XkbModel "macintosh" '; $keyboardsection_part3_v4 = ' Option "XkbRules" "xfree86" - Option "XkbModel" "macintosh" '; } else { $keyboardsection_part3 = ' @@ -578,12 +574,10 @@ $keyboardsection_part3 = ' XkbSymbols "us(pc105)" XkbGeometry "pc" XkbRules "xfree86" - XkbModel "pc105" '; $keyboardsection_part3_v4 = ' Option "XkbRules" "xfree86" - Option "XkbModel" "pc105" '; } -- cgit v1.2.1