1#! /usr/bin/sh 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License, Version 1.0 only 7# (the "License"). You may not use this file except in compliance 8# with the License. 9# 10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11# or http://www.opensolaris.org/os/licensing. 12# See the License for the specific language governing permissions 13# and limitations under the License. 14# 15# When distributing Covered Code, include this CDDL HEADER in each 16# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17# If applicable, add the following below this CDDL HEADER, with the 18# fields enclosed by brackets "[]" replaced with your own identifying 19# information: Portions Copyright [yyyy] [name of copyright owner] 20# 21# CDDL HEADER END 22# 23# 24# ident "%Z%%M% %I% %E% SMI" 25# 26# Copyright (c) 2001 by Sun Microsystems, Inc. 27# All rights reserved. 28# 29 30KBD_TYPE=`/usr/bin/kbd -t` 31 32# (Really, should pick this up from the keyboard device node keyboard-type 33# value, or the 1275 PC keyboard binding "layout" property.) 34KBD_LAYOUT_NAME="`/usr/sbin/eeprom kbd-type | /usr/bin/sed -n s/kbd-type=//p`" 35 36case "$KBD_TYPE" in 37"USB keyboard") 38 case "$KBD_LAYOUT_NAME" in 39 "") LAYOUT= ;; 40 "Czech" ) LAYOUT= ;; 41 "Danish" ) LAYOUT=6 ;; 42 "Dutch" ) LAYOUT=18 ;; 43 "French" ) LAYOUT=8 ;; 44 "French-Canadian" ) LAYOUT= ;; 45 "German" ) LAYOUT=9 ;; 46 "Greek" ) LAYOUT= ;; 47 "Hungarian" ) LAYOUT= ;; 48 "Italian" ) LAYOUT=14 ;; 49 "Japanese(106)" ) LAYOUT=15 ;; 50 "Japanese(J3100)" ) LAYOUT= ;; 51 "Latvian" ) LAYOUT= ;; 52 "Lithuanian" ) LAYOUT= ;; 53 "Polish" ) LAYOUT= ;; 54 "Korean" ) LAYOUT=16 ;; 55 "Norwegian" ) LAYOUT=19 ;; 56 "Portuguese" ) LAYOUT=22 ;; 57 "Russian" ) LAYOUT= ;; 58 "Spanish" ) LAYOUT=25 ;; 59 "Swedish" ) LAYOUT=26 ;; 60 "Swiss-French" ) LAYOUT=27 ;; 61 "Swiss-German" ) LAYOUT=28 ;; 62 "Taiwanese" ) LAYOUT=30 ;; 63 "Turkish" ) LAYOUT= ;; 64 "UK-English" ) LAYOUT=32 ;; 65 "US-English" ) LAYOUT=33 ;; 66 "US-English(Microsoft-Natural)" ) LAYOUT=33 ;; 67 "US-English(104-Key)" ) LAYOUT=33 ;; 68 *) LAYOUT= ;; 69 esac 70 ;; 71"PC") 72 case "$KBD_LAYOUT_NAME" in 73 "") LAYOUT= ;; 74 "Czech" ) LAYOUT=53 ;; 75 "Danish" ) LAYOUT=36 ;; 76 "Dutch" ) LAYOUT=39 ;; 77 "French" ) LAYOUT=35 ;; 78 "French-Canadian" ) LAYOUT=50 ;; 79 "German" ) LAYOUT=37 ;; 80 "Greek" ) LAYOUT=57 ;; 81 "Hungarian" ) LAYOUT=51 ;; 82 "Italian" ) LAYOUT=38 ;; 83 "Japanese(106)" ) LAYOUT=49 ;; 84 "Japanese(J3100)" ) LAYOUT=34 ;; 85 "Latvian" ) LAYOUT=55 ;; 86 "Lithuanian" ) LAYOUT=59 ;; 87 "Polish" ) LAYOUT=52 ;; 88 "Korean" ) LAYOUT=47 ;; 89 "Norwegian" ) LAYOUT=40 ;; 90 "Portuguese" ) LAYOUT=41 ;; 91 "Russian" ) LAYOUT=54 ;; 92 "Spanish" ) LAYOUT=42 ;; 93 "Swedish" ) LAYOUT=43 ;; 94 "Swiss-French" ) LAYOUT=44 ;; 95 "Swiss-German" ) LAYOUT=45 ;; 96 "Taiwanese" ) LAYOUT=48 ;; 97 "Turkish" ) LAYOUT=56 ;; 98 "UK-English" ) LAYOUT=46 ;; 99 "US-English" ) LAYOUT=1 ;; 100 "US-English(Microsoft-Natural)" ) LAYOUT=1001 ;; 101 "US-English(104-Key)" ) LAYOUT=1001 ;; 102 *) LAYOUT=0 ;; 103 esac 104 ;; 105esac 106 107 108if test -n "$LAYOUT" 109then 110 # Set the layout for a non-self-ID keyboard. 111 # loadkeys -s is a project private interface, and subject to change 112 # without notice. 113 /usr/bin/loadkeys -s $LAYOUT 114fi 115