xref: /illumos-gate/usr/src/data/bhyve/kbdlayout/default (revision d7b72f7b52f902da47cc7210a9121f4caabbcb9c)
1*d7b72f7bSAndy Fiddaman# bhyve ps2kbd keyboard layout file (US - default)
2*d7b72f7bSAndy Fiddaman#
3*d7b72f7bSAndy Fiddaman# Created by: Koine Yuusuke(koinec) <koinec@users.osdn.me>
4*d7b72f7bSAndy Fiddaman#
5*d7b72f7bSAndy Fiddaman# $FreeBSD$
6*d7b72f7bSAndy Fiddaman
7*d7b72f7bSAndy Fiddaman# for those who create the Keyboard Layout File. ******************************
8*d7b72f7bSAndy Fiddaman#  To create the keyboard layout file, first copy this 'default' file into the
9*d7b72f7bSAndy Fiddaman#  same dir. with the layout name as the file name.
10*d7b72f7bSAndy Fiddaman#  The file name is a character string that can be specified as it is in the
11*d7b72f7bSAndy Fiddaman#  -k option of the bhyve command, so a normal language name is desirable.
12*d7b72f7bSAndy Fiddaman#  Then, it is necessary to define the difference between the standard US keyboard
13*d7b72f7bSAndy Fiddaman#  and the keyboard for each language according to the setting method described
14*d7b72f7bSAndy Fiddaman#  in the comment below.
15*d7b72f7bSAndy Fiddaman#
16*d7b72f7bSAndy Fiddaman#  Note that lines starting with '#' and blank lines are ignored.
17*d7b72f7bSAndy Fiddaman#  In addition, the definition of the standard layout setting (US keyboard)
18*d7b72f7bSAndy Fiddaman#  is described as a comment line below for reference.
19*d7b72f7bSAndy Fiddaman#  So you usually only need to remove the '#' and fix it to the correct ScanCode
20*d7b72f7bSAndy Fiddaman#  only on the lines of the key that you can't type correctly with the standard
21*d7b72f7bSAndy Fiddaman#  US keyboard settings.
22*d7b72f7bSAndy Fiddaman
23*d7b72f7bSAndy Fiddaman
24*d7b72f7bSAndy Fiddaman# Alphabet/Number/Sign Keys ---------------------------------------------------
25*d7b72f7bSAndy Fiddaman#   Format:
26*d7b72f7bSAndy Fiddaman#     'Chr',ScanCode(Hex); <Comment>
27*d7b72f7bSAndy Fiddaman#       or
28*d7b72f7bSAndy Fiddaman#     AsciiCode(Hex),ScanCode(Hex); <Comment>
29*d7b72f7bSAndy Fiddaman#
30*d7b72f7bSAndy Fiddaman#  If there are ASCII characters that cannot be entered correctly with the
31*d7b72f7bSAndy Fiddaman#  standard settings(US Keyboard layout), delete the "#" at the beginning of the
32*d7b72f7bSAndy Fiddaman#  relevant line below and set the correct ScanCode.
33*d7b72f7bSAndy Fiddaman#
34*d7b72f7bSAndy Fiddaman#  For example, when a Japanese Keyboard is used, the '@' sign cannot be input
35*d7b72f7bSAndy Fiddaman#  correctly and the number '2' is input.
36*d7b72f7bSAndy Fiddaman#  This is because the US keyboard can input the '@' sign with the Shift + number'2'
37*d7b72f7bSAndy Fiddaman#  keys, and the ScanCode of the '@' sign is the number '2' key by default.
38*d7b72f7bSAndy Fiddaman#  In this case, remove the '#' at the beginning of the line with the '@' sign
39*d7b72f7bSAndy Fiddaman#  below and correct the ScanCode from 0x1e to 0x54 so that you can enter it
40*d7b72f7bSAndy Fiddaman#  correctly.
41*d7b72f7bSAndy Fiddaman#  ScanCode differs depending on the keyboard of eash language, so check it on
42*d7b72f7bSAndy Fiddaman#  the Internet.
43*d7b72f7bSAndy Fiddaman#  Note that keys that have no problems with input have the same settings as
44*d7b72f7bSAndy Fiddaman#  the US keyboard, so you do not need to set anything below.
45*d7b72f7bSAndy Fiddaman#  See the "/usr/share/bhyve/kbdlayout/jp106" file for the specific setting method.
46*d7b72f7bSAndy Fiddaman
47*d7b72f7bSAndy Fiddaman# '!',0x16;	!  (0x21)
48*d7b72f7bSAndy Fiddaman# '"',0x52;	"  (0x22)
49*d7b72f7bSAndy Fiddaman# '#',0x26;	#  (0x23)
50*d7b72f7bSAndy Fiddaman# '$',0x25;	$  (0x24)
51*d7b72f7bSAndy Fiddaman# '%',0x2e;	%  (0x25)
52*d7b72f7bSAndy Fiddaman# '&',0x3d;	&  (0x26)
53*d7b72f7bSAndy Fiddaman# ''',0x52;	'  (0x27)
54*d7b72f7bSAndy Fiddaman# '(',0x46;	(  (0x28)
55*d7b72f7bSAndy Fiddaman# ')',0x45;	)  (0x29)
56*d7b72f7bSAndy Fiddaman# '*',0x3e;	*  (0x2a)
57*d7b72f7bSAndy Fiddaman# '+',0x55;	+  (0x2b)
58*d7b72f7bSAndy Fiddaman# ',',0x41;	,  (0x2c)
59*d7b72f7bSAndy Fiddaman# '-',0x4e;	-  (0x2d)
60*d7b72f7bSAndy Fiddaman# '.',0x49;	.  (0x2e)
61*d7b72f7bSAndy Fiddaman# '/',0x4a;	/  (0x2f)
62*d7b72f7bSAndy Fiddaman
63*d7b72f7bSAndy Fiddaman# '0',0x45;	0  (0x30)
64*d7b72f7bSAndy Fiddaman# '1',0x16;	1  (0x31)
65*d7b72f7bSAndy Fiddaman# '2',0x1e;	2  (0x32)
66*d7b72f7bSAndy Fiddaman# '3',0x26;	3  (0x33)
67*d7b72f7bSAndy Fiddaman# '4',0x25;	4  (0x34)
68*d7b72f7bSAndy Fiddaman# '5',0x2e;	5  (0x35)
69*d7b72f7bSAndy Fiddaman# '6',0x36;	6  (0x36)
70*d7b72f7bSAndy Fiddaman# '7',0x3d;	7  (0x37)
71*d7b72f7bSAndy Fiddaman# '8',0x3e;	8  (0x38)
72*d7b72f7bSAndy Fiddaman# '9',0x46;	9  (0x39)
73*d7b72f7bSAndy Fiddaman# ':',0x4c;	:  (0x3a)
74*d7b72f7bSAndy Fiddaman# ';',0x4c;	;  (0x3b)
75*d7b72f7bSAndy Fiddaman# '<',0x41;	<  (0x3c)
76*d7b72f7bSAndy Fiddaman# '=',0x55;	=  (0x3d)
77*d7b72f7bSAndy Fiddaman# '>',0x49;	>  (0x3e)
78*d7b72f7bSAndy Fiddaman# '?',0x4a;	?  (0x3f)
79*d7b72f7bSAndy Fiddaman
80*d7b72f7bSAndy Fiddaman# '@',0x1e;	@  (0x40)
81*d7b72f7bSAndy Fiddaman# 'A',0x1c;	A  (0x41)
82*d7b72f7bSAndy Fiddaman# 'B',0x32;	B  (0x42)
83*d7b72f7bSAndy Fiddaman# 'C',0x21;	C  (0x43)
84*d7b72f7bSAndy Fiddaman# 'D',0x23;	D  (0x44)
85*d7b72f7bSAndy Fiddaman# 'E',0x24;	E  (0x45)
86*d7b72f7bSAndy Fiddaman# 'F',0x2b;	F  (0x46)
87*d7b72f7bSAndy Fiddaman# 'G',0x34;	G  (0x47)
88*d7b72f7bSAndy Fiddaman# 'H',0x33;	H  (0x48)
89*d7b72f7bSAndy Fiddaman# 'I',0x43;	I  (0x49)
90*d7b72f7bSAndy Fiddaman# 'J',0x3b;	J  (0x4a)
91*d7b72f7bSAndy Fiddaman# 'K',0x42;	K  (0x4b)
92*d7b72f7bSAndy Fiddaman# 'L',0x4b;	L  (0x4c)
93*d7b72f7bSAndy Fiddaman# 'M',0x3a;	M  (0x4d)
94*d7b72f7bSAndy Fiddaman# 'N',0x31;	N  (0x4e)
95*d7b72f7bSAndy Fiddaman# 'O',0x44;	O  (0x4f)
96*d7b72f7bSAndy Fiddaman
97*d7b72f7bSAndy Fiddaman# 'P',0x4d;	P  (0x50)
98*d7b72f7bSAndy Fiddaman# 'Q',0x15;	Q  (0x51)
99*d7b72f7bSAndy Fiddaman# 'R',0x2d;	R  (0x52)
100*d7b72f7bSAndy Fiddaman# 'S',0x1b;	S  (0x53)
101*d7b72f7bSAndy Fiddaman# 'T',0x2c;	T  (0x54)
102*d7b72f7bSAndy Fiddaman# 'U',0x3c;	U  (0x55)
103*d7b72f7bSAndy Fiddaman# 'V',0x2a;	V  (0x56)
104*d7b72f7bSAndy Fiddaman# 'W',0x1d;	W  (0x57)
105*d7b72f7bSAndy Fiddaman# 'X',0x22;	X  (0x58)
106*d7b72f7bSAndy Fiddaman# 'Y',0x35;	Y  (0x59)
107*d7b72f7bSAndy Fiddaman# 'Z',0x1a;	Z  (0x5a)
108*d7b72f7bSAndy Fiddaman# '[',0x54;	[  (0x5b)
109*d7b72f7bSAndy Fiddaman# '\',0x5d;	\  (0x5c)
110*d7b72f7bSAndy Fiddaman# ']',0x5b;	]  (0x5d)
111*d7b72f7bSAndy Fiddaman# '^',0x36;	^  (0x5e)
112*d7b72f7bSAndy Fiddaman# '_',0x4e;	_  (0x5f)
113*d7b72f7bSAndy Fiddaman
114*d7b72f7bSAndy Fiddaman# '`',0x0e;	`  (0x60)
115*d7b72f7bSAndy Fiddaman# 'a',0x1c;	a  (0x61)
116*d7b72f7bSAndy Fiddaman# 'b',0x32;	b  (0x62)
117*d7b72f7bSAndy Fiddaman# 'c',0x21;	c  (0x63)
118*d7b72f7bSAndy Fiddaman# 'd',0x23;	d  (0x64)
119*d7b72f7bSAndy Fiddaman# 'e',0x24;	e  (0x65)
120*d7b72f7bSAndy Fiddaman# 'f',0x2b;	f  (0x66)
121*d7b72f7bSAndy Fiddaman# 'g',0x34;	g  (0x67)
122*d7b72f7bSAndy Fiddaman# 'h',0x33;	h  (0x68)
123*d7b72f7bSAndy Fiddaman# 'i',0x43;	i  (0x69)
124*d7b72f7bSAndy Fiddaman# 'j',0x3b;	j  (0x6a)
125*d7b72f7bSAndy Fiddaman# 'k',0x42;	k  (0x6b)
126*d7b72f7bSAndy Fiddaman# 'l',0x4b;	l  (0x6c)
127*d7b72f7bSAndy Fiddaman# 'm',0x3a;	m  (0x6d)
128*d7b72f7bSAndy Fiddaman# 'n',0x31;	n  (0x6e)
129*d7b72f7bSAndy Fiddaman# 'o',0x44;	o  (0x6f)
130*d7b72f7bSAndy Fiddaman
131*d7b72f7bSAndy Fiddaman# 'p',0x4d;	p  (0x70)
132*d7b72f7bSAndy Fiddaman# 'q',0x15;	q  (0x71)
133*d7b72f7bSAndy Fiddaman# 'r',0x2d;	r  (0x72)
134*d7b72f7bSAndy Fiddaman# 's',0x1b;	s  (0x73)
135*d7b72f7bSAndy Fiddaman# 't',0x2c;	t  (0x74)
136*d7b72f7bSAndy Fiddaman# 'u',0x3c;	u  (0x75)
137*d7b72f7bSAndy Fiddaman# 'v',0x2a;	v  (0x76)
138*d7b72f7bSAndy Fiddaman# 'w',0x1d;	w  (0x77)
139*d7b72f7bSAndy Fiddaman# 'x',0x22;	x  (0x78)
140*d7b72f7bSAndy Fiddaman# 'y',0x35;	y  (0x79)
141*d7b72f7bSAndy Fiddaman# 'z',0x1a;	z  (0x7a)
142*d7b72f7bSAndy Fiddaman# '{',0x54;	{  (0x7b)
143*d7b72f7bSAndy Fiddaman# '|',0x5d;	|  (0x7c)
144*d7b72f7bSAndy Fiddaman# '}',0x5b;	}  (0x7d)
145*d7b72f7bSAndy Fiddaman# '~',0x0e;	~  (0x7e)
146*d7b72f7bSAndy Fiddaman
147*d7b72f7bSAndy Fiddaman
148*d7b72f7bSAndy Fiddaman# Functional Keys -------------------------------------------------------------
149*d7b72f7bSAndy Fiddaman#   Format:
150*d7b72f7bSAndy Fiddaman#     Xorg KeySym(Hex:2Byte),ScanCode(Hex); <Comment>
151*d7b72f7bSAndy Fiddaman#       or
152*d7b72f7bSAndy Fiddaman#     Xorg KeySym(Hex:2Byte),ScanCode(Hex),Prefix(Hex); <Comment>
153*d7b72f7bSAndy Fiddaman#
154*d7b72f7bSAndy Fiddaman#  Key definitions other than alphanumeric characters such as Enter and Escape
155*d7b72f7bSAndy Fiddaman#  are set in this section.
156*d7b72f7bSAndy Fiddaman#  If there is a key that can not be entered correctly with the standard settings
157*d7b72f7bSAndy Fiddaman#  (US Keyboard layout),, delete the '#' at the beginning of the corresponding
158*d7b72f7bSAndy Fiddaman#  line and set the correct scan code.
159*d7b72f7bSAndy Fiddaman#  The Xorg KeySym Code can be checked by using the 'xev' command from X window
160*d7b72f7bSAndy Fiddaman#  on the guest OS.
161*d7b72f7bSAndy Fiddaman#  In addition, some keys have ScanCodes that have a Prefix Byte.
162*d7b72f7bSAndy Fiddaman#  In this case, define '0xe0' as the third argument.(example Home Key,etc)
163*d7b72f7bSAndy Fiddaman#  Note that keys that have no problems with input have the same settings as
164*d7b72f7bSAndy Fiddaman#  the US keyboard, so you do not need to set anything below.
165*d7b72f7bSAndy Fiddaman#  See the "/usr/share/bhyve/kbdlayout/jp106" file for the specific setting method.
166*d7b72f7bSAndy Fiddaman
167*d7b72f7bSAndy Fiddaman# 0xff08,0x66;		Back space
168*d7b72f7bSAndy Fiddaman# 0xff09,0x0d;		Tab
169*d7b72f7bSAndy Fiddaman# 0xff0d,0x5a;		Return
170*d7b72f7bSAndy Fiddaman# 0xff1b,0x76;		Escape
171*d7b72f7bSAndy Fiddaman# 0xff50,0x6c,0xe0; 	Home
172*d7b72f7bSAndy Fiddaman# 0xff51,0x6b,0xe0; 	Left arrow
173*d7b72f7bSAndy Fiddaman# 0xff52,0x75,0xe0; 	Up arrow
174*d7b72f7bSAndy Fiddaman# 0xff53,0x74,0xe0; 	Right arrow
175*d7b72f7bSAndy Fiddaman# 0xff54,0x72,0xe0; 	Down arrow
176*d7b72f7bSAndy Fiddaman# 0xff55,0x7d,0xe0; 	PgUp
177*d7b72f7bSAndy Fiddaman# 0xff56,0x7a,0xe0; 	PgDown
178*d7b72f7bSAndy Fiddaman# 0xff57,0x69,0xe0; 	End
179*d7b72f7bSAndy Fiddaman# 0xff63,0x70,0xe0; 	Ins
180*d7b72f7bSAndy Fiddaman# 0xff8d,0x5a,0xe0; 	Keypad Enter
181*d7b72f7bSAndy Fiddaman# 0xffe1,0x12;		Left shift
182*d7b72f7bSAndy Fiddaman# 0xffe2,0x59;		Right shift
183*d7b72f7bSAndy Fiddaman# 0xffe3,0x14;		Left control
184*d7b72f7bSAndy Fiddaman# 0xffe4,0x14,0xe0; 	Right control
185*d7b72f7bSAndy Fiddaman# 0xffe9,0x11;		Left alt
186*d7b72f7bSAndy Fiddaman# 0xfe03,0x11,0xe0; 	AltGr
187*d7b72f7bSAndy Fiddaman# 0xffea,0x11,0xe0; 	Right alt
188*d7b72f7bSAndy Fiddaman# 0xffeb,0x1f,0xe0; 	Left Windows
189*d7b72f7bSAndy Fiddaman# 0xffec,0x27,0xe0; 	Right Windows
190*d7b72f7bSAndy Fiddaman# 0xffbe,0x05;		F1
191*d7b72f7bSAndy Fiddaman# 0xffbf,0x06;		F2
192*d7b72f7bSAndy Fiddaman# 0xffc0,0x04;		F3
193*d7b72f7bSAndy Fiddaman# 0xffc1,0x0c;		F4
194*d7b72f7bSAndy Fiddaman# 0xffc2,0x03;		F5
195*d7b72f7bSAndy Fiddaman# 0xffc3,0x0b;		F6
196*d7b72f7bSAndy Fiddaman# 0xffc4,0x83;		F7
197*d7b72f7bSAndy Fiddaman# 0xffc5,0x0a;		F8
198*d7b72f7bSAndy Fiddaman# 0xffc6,0x01;		F9
199*d7b72f7bSAndy Fiddaman# 0xffc7,0x09;		F10
200*d7b72f7bSAndy Fiddaman# 0xffc8,0x78;		F11
201*d7b72f7bSAndy Fiddaman# 0xffc9,0x07;		F12
202*d7b72f7bSAndy Fiddaman# 0xffff,0x71,0xe0;	Del
203*d7b72f7bSAndy Fiddaman# 0xff14,0x7e;		ScrollLock
204*d7b72f7bSAndy Fiddaman
205*d7b72f7bSAndy Fiddaman
206*d7b72f7bSAndy Fiddaman# NumLock and Keypads ---------------------------------------------------------
207*d7b72f7bSAndy Fiddaman#
208*d7b72f7bSAndy Fiddaman#  The numeric keypad settings are the same as the Functional Key section above.
209*d7b72f7bSAndy Fiddaman
210*d7b72f7bSAndy Fiddaman# 0xff7f,0x77; 		NumLock
211*d7b72f7bSAndy Fiddaman# 0xffaf,0x4a,0xe0; 	Keypad slash
212*d7b72f7bSAndy Fiddaman# 0xffaa,0x7c; 		Keypad asterisk
213*d7b72f7bSAndy Fiddaman# 0xffad,0x7b; 		Keypad minus
214*d7b72f7bSAndy Fiddaman# 0xffab,0x79;	 	Keypad plus
215*d7b72f7bSAndy Fiddaman# 0xffb7,0x6c; 		Keypad 7
216*d7b72f7bSAndy Fiddaman# 0xff95,0x6c; 		Keypad home
217*d7b72f7bSAndy Fiddaman# 0xffb8,0x75; 		Keypad 8
218*d7b72f7bSAndy Fiddaman# 0xff97,0x75; 		Keypad up arrow
219*d7b72f7bSAndy Fiddaman# 0xffb9,0x7d; 		Keypad 9
220*d7b72f7bSAndy Fiddaman# 0xff9a,0x7d; 		Keypad PgUp
221*d7b72f7bSAndy Fiddaman# 0xffb4,0x6b; 		Keypad 4
222*d7b72f7bSAndy Fiddaman# 0xff96,0x6b; 		Keypad left arrow
223*d7b72f7bSAndy Fiddaman# 0xffb5,0x73; 		Keypad 5
224*d7b72f7bSAndy Fiddaman# 0xff9d,0x73; 		Keypad empty
225*d7b72f7bSAndy Fiddaman# 0xffb6,0x74; 		Keypad 6
226*d7b72f7bSAndy Fiddaman# 0xff98,0x74; 		Keypad right arrow
227*d7b72f7bSAndy Fiddaman# 0xffb1,0x69; 		Keypad 1
228*d7b72f7bSAndy Fiddaman# 0xff9c,0x69; 		Keypad end
229*d7b72f7bSAndy Fiddaman# 0xffb2,0x72; 		Keypad 2
230*d7b72f7bSAndy Fiddaman# 0xff99,0x72; 		Keypad down arrow
231*d7b72f7bSAndy Fiddaman# 0xffb3,0x7a; 		Keypad 3
232*d7b72f7bSAndy Fiddaman# 0xff9b,0x7a; 		Keypad PgDown
233*d7b72f7bSAndy Fiddaman# 0xffb0,0x70; 		Keypad 0
234*d7b72f7bSAndy Fiddaman# 0xff9e,0x70; 		Keypad ins
235*d7b72f7bSAndy Fiddaman# 0xffae,0x71; 		Keypad .
236*d7b72f7bSAndy Fiddaman# 0xff9f,0x71; 		Keypad del
237*d7b72f7bSAndy Fiddaman
238*d7b72f7bSAndy Fiddaman
239*d7b72f7bSAndy Fiddaman# Language Specific Keys -------------------------------------------------------
240*d7b72f7bSAndy Fiddaman#
241*d7b72f7bSAndy Fiddaman#  If a key not exist in the US keyboard is added to the keyboard of each language,
242*d7b72f7bSAndy Fiddaman#  it is necessary to add the combination of Xorg KeySym and ScanCode of the
243*d7b72f7bSAndy Fiddaman#  corresponding key.
244*d7b72f7bSAndy Fiddaman#  The setting format is the same as the Functional Key section above.
245*d7b72f7bSAndy Fiddaman#   example:
246*d7b72f7bSAndy Fiddaman#     0xff2a,0x0e;   Hankaku/Zenkaku|Kanji (Japanese 106 keyboard original Key)
247*d7b72f7bSAndy Fiddaman
248*d7b72f7bSAndy Fiddaman
249