问题描述
我尝试过更改会话键盘,但是它不起作用。如果我走
设置→设置管理器→键盘→布局(顶部标签)→取消选中“使用系统默认值”→删除当前键盘/添加新键盘
我发现当我重新登录时,正确的键盘仍然无法正常工作。
最佳办法
您可以使用以下命令更改默认系统键盘硬件(例如"Generic 105-key keyboard"
到"Generic 101-key keyboard"
)的设置以及系统键盘布局(例如"us-intl"
到"us"
)
sudo dpkg-reconfigure keyboard-configuration
次佳办法
查看此文件/usr/share/console-setup/KeyboardNames.pl
。在其中,您将看到Perl哈希哈希:
'us' => {
'Cherokee' => 'chr',
'English (Colemak)' => 'colemak',
'English (Dvorak alternative international no dead keys)' => 'dvorak-alt-intl',
'English (Dvorak international with dead keys)' => 'dvorak-intl',
'English (Dvorak)' => 'dvorak',
'English (Macintosh)' => 'mac',
'English (US, alternative international)' => 'alt-intl',
'English (US, international with dead keys)' => 'intl',
'English (US, with euro on 5)' => 'euro',
'English (classic Dvorak)' => 'dvorak-classic',
'English (international AltGr dead keys)' => 'altgr-intl',
'English (layout toggle on multiply/divide key)' => 'olpc2',
'English (left handed Dvorak)' => 'dvorak-l',
'English (programmer Dvorak)' => 'dvp',
'English (right handed Dvorak)' => 'dvorak-r',
'Russian (US, phonetic)' => 'rus',
'Serbo-Croatian (US)' => 'hbs',
}
假设您要
'English (international AltGr dead keys)' => 'altgr-intl',
代替
'English (US, international with dead keys)' => 'intl',
首先,看到它们都属于我们。现在编辑/etc/default/keyboard
并更改它
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="intl"
XKBOPTIONS=""
至
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="altgr-intl"
XKBOPTIONS=""