diff options
| author | qz150045 <none@none> | 2006-01-16 01:03:19 -0800 |
|---|---|---|
| committer | qz150045 <none@none> | 2006-01-16 01:03:19 -0800 |
| commit | 7db6e34e0974b29ab599ed5dbc95a2f71810f321 (patch) | |
| tree | 4d5487def416b3e2d42529edb44f5fc9396891d1 /usr/src/cmd/loadkeys | |
| parent | 21d7f835c9bac5f9e80c72fc972ee5b288845983 (diff) | |
| download | illumos-joyent-7db6e34e0974b29ab599ed5dbc95a2f71810f321.tar.gz | |
PSARC 2005/535 zero-CountryCode keyboard layout support
6265017 low cost PC keyboards don't send correct bCountryCode byte
Diffstat (limited to 'usr/src/cmd/loadkeys')
| -rw-r--r-- | usr/src/cmd/loadkeys/set_keyboard_layout | 103 | ||||
| -rw-r--r-- | usr/src/cmd/loadkeys/type_6/Makefile | 9 | ||||
| -rw-r--r-- | usr/src/cmd/loadkeys/type_6/kbd_layouts | 67 |
3 files changed, 77 insertions, 102 deletions
diff --git a/usr/src/cmd/loadkeys/set_keyboard_layout b/usr/src/cmd/loadkeys/set_keyboard_layout index cc36d7ba22..df2a170b9c 100644 --- a/usr/src/cmd/loadkeys/set_keyboard_layout +++ b/usr/src/cmd/loadkeys/set_keyboard_layout @@ -21,108 +21,11 @@ # #pragma ident "%Z%%M% %I% %E% SMI" # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -KBD_TYPE=`/usr/bin/kbd -t` - -# (Really, should pick this up from the keyboard device node keyboard-type -# value, or the 1275 PC keyboard binding "layout" property.) +# get the layout name from the eeprom and set it into kernel. KBD_LAYOUT_NAME="`/usr/sbin/eeprom kbd-type | /usr/bin/sed -n s/kbd-type=//p`" -case "$KBD_TYPE" in -"USB keyboard") - case "$KBD_LAYOUT_NAME" in - "") LAYOUT= ;; - "Belgian" ) LAYOUT=2 ;; - "Czech" ) LAYOUT= ;; - "Danish" ) LAYOUT=6 ;; - "Dutch" ) LAYOUT=18 ;; - "Finnish" ) LAYOUT=7 ;; - "French" ) LAYOUT=8 ;; - "French-Canadian" ) LAYOUT= ;; - "German" ) LAYOUT=9 ;; - "Greek" ) LAYOUT= ;; - "Hungarian" ) LAYOUT= ;; - "Italian" ) LAYOUT=14 ;; - "Japanese(106)" ) LAYOUT=15 ;; - "Japanese(J3100)" ) LAYOUT= ;; - "Latvian" ) LAYOUT= ;; - "Lithuanian" ) LAYOUT= ;; - "Polish" ) LAYOUT= ;; - "Korean" ) LAYOUT=16 ;; - "Norwegian" ) LAYOUT=19 ;; - "Portuguese" ) LAYOUT=22 ;; - "Russian" ) LAYOUT=23 ;; - "Spanish" ) LAYOUT=25 ;; - "Swedish" ) LAYOUT=26 ;; - "Swiss-French" ) LAYOUT=27 ;; - "Swiss-German" ) LAYOUT=28 ;; - "Taiwanese" ) LAYOUT=30 ;; - "Turkish" ) LAYOUT= ;; - "TurkishQ" ) LAYOUT=31 ;; - "TurkishF" ) LAYOUT=35 ;; - "UK-English" ) LAYOUT=32 ;; - "US-English" ) LAYOUT=33 ;; - "US-English(Microsoft-Natural)" ) LAYOUT=33 ;; - "US-English(104-Key)" ) LAYOUT=33 ;; - "Slovenian" ) LAYOUT=256 ;; - "Slovakian" ) LAYOUT=24 ;; - "Serbia-And-Montenegro") LAYOUT=257 ;; - "Icelandic" ) LAYOUT=258 ;; - "Croatian" ) LAYOUT=259 ;; - "Bulgarian" ) LAYOUT=260 ;; - "Belarusian" ) LAYOUT=261 ;; - "Malta_US" ) LAYOUT=262 ;; - "Malta_UK" ) LAYOUT=263 ;; - "Albanian" ) LAYOUT=264 ;; - *) LAYOUT= ;; - esac - ;; -"PC") - case "$KBD_LAYOUT_NAME" in - "") LAYOUT= ;; - "Belgian" ) LAYOUT=2 ;; - "Czech" ) LAYOUT=53 ;; - "Danish" ) LAYOUT=36 ;; - "Dutch" ) LAYOUT=39 ;; - "Finnish" ) LAYOUT=7 ;; - "French" ) LAYOUT=35 ;; - "French-Canadian" ) LAYOUT=50 ;; - "German" ) LAYOUT=37 ;; - "Greek" ) LAYOUT=57 ;; - "Hungarian" ) LAYOUT=51 ;; - "Italian" ) LAYOUT=38 ;; - "Japanese(106)" ) LAYOUT=49 ;; - "Japanese(J3100)" ) LAYOUT=34 ;; - "Latvian" ) LAYOUT=55 ;; - "Lithuanian" ) LAYOUT=59 ;; - "Polish" ) LAYOUT=52 ;; - "Korean" ) LAYOUT=47 ;; - "Norwegian" ) LAYOUT=40 ;; - "Portuguese" ) LAYOUT=41 ;; - "Russian" ) LAYOUT=54 ;; - "Spanish" ) LAYOUT=42 ;; - "Swedish" ) LAYOUT=43 ;; - "Swiss-French" ) LAYOUT=44 ;; - "Swiss-German" ) LAYOUT=45 ;; - "Taiwanese" ) LAYOUT=48 ;; - "Turkish" ) LAYOUT=56 ;; - "UK-English" ) LAYOUT=46 ;; - "US-English" ) LAYOUT=1 ;; - "US-English(Microsoft-Natural)" ) LAYOUT=1001 ;; - "US-English(104-Key)" ) LAYOUT=1001 ;; - *) LAYOUT=0 ;; - esac - ;; -esac - - -if test -n "$LAYOUT" -then - # Set the layout for a non-self-ID keyboard. - # loadkeys -s is a project private interface, and subject to change - # without notice. - /usr/bin/loadkeys -s $LAYOUT -fi +/usr/bin/kbd -s $KBD_LAYOUT_NAME diff --git a/usr/src/cmd/loadkeys/type_6/Makefile b/usr/src/cmd/loadkeys/type_6/Makefile index 0a41d0398b..eba73f7854 100644 --- a/usr/src/cmd/loadkeys/type_6/Makefile +++ b/usr/src/cmd/loadkeys/type_6/Makefile @@ -22,7 +22,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # cmd/loadkeys/type_6/Makefile @@ -35,11 +35,14 @@ KEYTABLES = \ iceland croatia bulgaria belarus maltaus \ maltauk albania turkeyq turkeyf +KEYTABLESCONFIG = kbd_layouts + include ../../Makefile.cmd ROOTKEYTABLESDIR= $(ROOTSHLIB)/keytables ROOTKEYDIR= $(ROOTKEYTABLESDIR)/type_6 ROOTKEYTABLES= $(KEYTABLES:%=$(ROOTKEYDIR)/%) +ROOTKEYTABLESCON= $(KEYTABLESCONFIG:%=$(ROOTKEYDIR)/%) # there is an install target for each ROOT layout link # @@ -54,6 +57,7 @@ LAYOUTS= \ ROOTLINKS= $(LAYOUTS:%=$(ROOTKEYDIR)/%) $(ROOTKEYTABLES) := FILEMODE = 444 +$(ROOTKEYTABLESCON) := FILEMODE = 444 # install rule $(ROOTKEYDIR)/%: % @@ -63,7 +67,8 @@ $(ROOTKEYDIR)/%: % all: $(KEYTABLES) -install: all $(ROOTKEYTABLESDIR) $(ROOTKEYDIR) $(ROOTKEYTABLES) $(ROOTLINKS) +install: all $(ROOTKEYTABLESDIR) $(ROOTKEYDIR) $(ROOTKEYTABLES) $(ROOTLINKS)\ + $(ROOTKEYTABLESCON) clean: diff --git a/usr/src/cmd/loadkeys/type_6/kbd_layouts b/usr/src/cmd/loadkeys/type_6/kbd_layouts new file mode 100644 index 0000000000..ec5053017d --- /dev/null +++ b/usr/src/cmd/loadkeys/type_6/kbd_layouts @@ -0,0 +1,67 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# The following lines define the keyboard layouts supported in kernel. +# The /usr/bin/kbd (-s option) reads the file to get the keyboard layout +# infomation. +# To add the new keytable, the new layout name and number need be defined +# below. +# + +Albanian=264 +Belarusian=261 +Belgian=2 +Bulgarian=260 +Croatian=259 +Danish=6 +Dutch=18 +Finnish=7 +French=8 +German=9 +Icelandic=258 +Italian=14 +Japanese-type6=271 +Japanese-106/type7=15 +Korean=16 +Malta_UK=263 +Malta_US=262 +Norwegian=19 +Portuguese=22 +Russian=23 +Serbia-And-Montenegro=257 +Slovenian=256 +Slovakian=24 +Spanish=25 +Swedish=26 +Swiss-French=27 +Swiss-German=28 +Taiwanese=30 +TurkishQ=31 +TurkishF=35 +UK-English=32 +US-English=33 |
