Answers:
使用xinput
和setxkbmap
实用程序,您可以从终端进行设置,以使每个键盘具有不同的布局。
首先,使用xinput -list | grep key
命令,您必须找到每个键盘的设备ID。这是一个例子(我的情况):
$ xinput -list | grep key
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ 2.4GHz 2way RF Receiver id=10 [slave keyboard (3)]
↳ HP Webcam id=12 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)]
↳ HP WMI hotkeys id=15 [slave keyboard (3)]
↳ USB Keyboard id=16 [slave keyboard (3)]
↳ USB Keyboard id=17 [slave keyboard (3)]
其次,使用setxkbmap -device <key_ID> -layout <layout_name>
,为每个键盘设置所需的布局。一个例子(对于我的键盘):
setxkbmap -device 3 -layout ro #My master keyboard is set to Romanian layout
setxkbmap -device 10 -layout us #The keyboard with id=10 is set to English (US) layout
setxkbmap -device 16 -layout ru #The keyboard with id=16 is set to EFor Russian layout