起因
最近用虚拟机在学习Linux系统的操作,原来拷贝的Linux虚拟系统设置是日文键盘,而偶用的是英文键盘
日文键盘的键要比英文键盘的键多,而且布局也不尽相同,导致连右反斜杠'\'居然也打不出。
so开始在网上设置方法。。。
经过
第一个方法没有成功,不知道是否是系统的原因,我用的是red hat9
修改当前的键盘布局(FAILING)
[root@localhost root]# cat /etc/sysconfig/keyboard
KEYBOARDTYPE="pc"
KEYTABLE="us"
结果
第二个方法成功了,共享一下。
修改配置文件XF86Config(SUCCESSFUL)
[root@localhost root]# vi
/etc/X11/XF86Config
修改 "XkbModel"
"pc105" 和
"XkbLayout"
"us"
Section
"InputDevice" # Specify which keyboard LEDs can be user-controlled (eg, with
xset(1)) # Option "Xleds" "1
2 3" # To disable the XKEYBOARD extension, uncomment
XkbDisable. # Option "XkbDisable" # To customise the XKB settings to suit your keyboard, modify
the # lines below (which are the
defaults). For example,
for a
non-U.S. # keyboard, you will probably want to
use: # Option "XkbModel" "pc102" # If you have a US Microsoft Natural keyboard, you can
use: # Option "XkbModel" "microsoft" # # Then to change the language, change the Layout
setting. # For example, a german layout can be obtained
with: # Option "XkbLayout"
"de" # or: # Option "XkbLayout"
"de" # Option "XkbVariant" "nodeadkeys" # # If you'd like to switch the positions of your capslock
and # control keys,
use: # Option "XkbOptions" "ctrl:swapcaps" # Or if you just want both to be control,
use: # Option "XkbOptions" "ctrl:nocaps" # Identifier "Keyboard0" Driver "kbd" Option "XkbModel"
"pc105" Option "XkbLayout"
"us" EndSection
参考键盘参数
keyboard: Keyboard instance, containing members:
info:
{'KEYBOARDTYPE': pc, 'KEYTABLE': us}
modelDict:
{'gr': ['Greek', 'el', 'pc102', ''], 'speakup': ['Speakup', 'us',
'pc105', ''], 'ru-cp1251': ['Russian (cp1251)', 'ru', 'pc102', ''],
'speakup-lt': ['Speakup (laptop)', 'us', 'pc105', ''], 'cf':
['French Canadian', 'ca_enhanced', 'pc102', ''], 'se-latin1':
['Swedish', 'se', 'pc102', ''], 'fr_CH-latin1': ['Swiss French
(latin1)', 'fr_CH', 'pc102', ''], 'fr-pc': ['French (pc)', 'fr',
'pc102', ''], 'ru-ms': ['Russian (Microsoft)', 'ru', 'pc102', ''],
'sk-qwerty': ['Slovakian', 'sk_qwerty', 'pc102', ''], 'ru2':
['Russian (ru2)', 'ru', 'pc102', ''], 'et': ['Estonian', 'ee',
'pc102', ''], 'ru1': ['Russian (ru1)', 'ru', 'pc102', ''], 'es':
['Spanish', 'es', 'pc102', ''], 'it-ibm': ['Italian (IBM)', 'it',
'pc102', ''], 'ru': ['Russian', 'ru', 'pc102', ''], 'fr-latin1':
['French (latin1)', 'fr', 'pc102', ''], 'no': ['Norwegian', 'no',
'pc102', ''], 'de-latin1-nodeadkeys': ['German (latin1 w/ no
deadkeys)', 'de', 'pc102', 'nodeadkeys'], 'ru_win': ['Russian
(win)', 'ru', 'pc105', ''], 'ua': ['Ukrainian', 'ua', 'pc102', ''],
'pt-latin1': ['Portuguese', 'pt', 'pc102', ''], 'it': ['Italian',
'it', 'pc102', ''], 'de-latin1': ['German (latin1)', 'de', 'pc102',
''], 'fr': ['French', 'fr', 'pc102', ''], 'pl': ['Polish', 'pl',
'pc102', ''], 'cz-lat2': ['Czechoslovakian', 'cz', 'pc102', ''],
'dk-latin1': ['Denmark (latin1)', 'dk', 'pc102', ''], 'bg':
['Bulgarian', 'bg', 'pc102', ''], 'dk': ['Denmark', 'dk', 'pc102',
''], 'be-latin1': ['Belgian (be-latin1)', 'be', 'pc102', ''],
'sg-latin1': ['Swiss German (latin1)', 'de_CH', 'pc102', ''],
'fr-latin0': ['French (latin0)', 'fr', 'pc102', ''], 'de':
['German', 'de', 'pc102', ''], 'hu': ['Hungarian', 'hu', 'pc102',
''], 'jp106': ['Japanese', 'jp', 'jp106',
''], 'us-acentos': ['U.S. International', 'us_intl',
'pc105', ''], 'fr_CH': ['Swiss French', 'fr_CH', 'pc102', ''],
'fi': ['Finnish', 'fi', 'pc102', ''], 'dvorak': ['Dvorak',
'dvorak', 'pc105', ''], 'it2': ['Italian (it2)', 'it', 'pc102',
''], 'fi-latin1': ['Finnish (latin1)', 'fi', 'pc102', ''],
'ro_win': ['Romanian', 'ro', 'pc102', ''], 'hu101': ['Hungarian
(101 key)', 'hu', 'pc102', ''], 'slovene': ['Slovenian', 'si',
'pc102', ''], 'br-abnt2': ['Brazilian (ABNT2)', 'br', 'abnt2',
''], 'us': ['U.S. English', 'us', 'pc105',
''], 'no-latin1': ['Norwegian (latin1)', 'no', 'pc102',
''], 'is-latin1': ['Iceland', 'is', 'pc102', ''], 'cz-us-qwertz':
['Czechoslovakian (qwertz)', 'cz', 'pc102', ''], 'uk': ['United
Kingdom', 'gb', 'pc101', ''], 'trq': ['Turkish', 'tr', 'pc102',
''], 'sg': ['Swiss German', 'de_CH', 'pc102', '']}