Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Jaakko Pallari
Jaakko Pallari

Posted on • Originally published atlepovirta.org on

Keyboard layout per device on Linux

I’ve been doing some pair programming where there are two sets of keyboards and mice connected to one computer. I prefer using a different keyboard layout than what my coworkers use. Fortunately, there is way to set a separate layout for each keyboard on Linux.

For this setup you needxinput andsetxkbmap commands. First, list all your input devices using commandxinput -list. You should get a list that looks something like this:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]⎜   ↳ ETPS/2 Elantech Touchpad                  id=12   [slave  pointer  (2)]⎜   ↳ Logitech USB Receiver                     id=14   [slave  pointer  (2)]⎜   ↳ Logitech USB Receiver                     id=15   [slave  pointer  (2)]⎣ 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)]    ↳ Sleep Button                              id=8    [slave  keyboard (3)]    ↳ USB2.0 0.3M UVC WebCam                    id=9    [slave  keyboard (3)]    ↳ Asus Laptop extra buttons                 id=10   [slave  keyboard (3)]    ↳ AT Translated Set 2 keyboard              id=11   [slave  keyboard (3)]    ↳ ACPI Virtual Keyboard Device              id=13   [slave  keyboard (3)]
Enter fullscreen modeExit fullscreen mode

Next, look for the keyboard that you wish to change the layout for. In my example, I only have one keyboard device listed: AT Translated Set 2 keyboard. The list also tells us the ID the device is assigned to, which is 11 in my case. You need to pass the ID to the commandsetxkbmap using option-device. For example, if I wanted to switch my keyboard layout to a finnish layout, the command would be:

setxkbmap -device 11 us
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Bringing people in the IT industry together to deliver exactly what is needed in a rapid, reliable, and stress-free way.
  • Location
    Finland
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp