# multiple keyboard layouts for multiple keyboards



## koshamo (May 29, 2018)

Hi guys.

I've seen the How To for setting up multiple keyboard layouts / to switch keyboard layout on the fly.

My question is:
I currently have a Laptop with german keyboard and german keyboard layout set up. 
German keyboards are not exactly what I call ergonomic when it comes to programming, having to use braces, brackets and other signs, that always need the AltGr key to be accessed. So I plan to buy a USB-keyboard with us layout, just for coding.

Is there a way to have the laptop keyboard layout set to de, while the external USB keyboard layout is set to us? If so, can you give me a hint where to look for a how to / documentation?

thanks in advance
Jochen


----------



## inf3rno (Jul 10, 2020)

Same here, I use multiple keyboards with different layouts and I have no idea how to do it properly in freebsd. In theory it should be set in some xorg config, but I guess I'll have to change layout every time I change keyboard, which is not too convenient. Plus my mechanical keyboard is a 70% one without arrows, so I cant even go through menus with it.


----------



## Mjölnir (Jul 10, 2020)

I have intentionally choosen a _swiss-international_ QWERTZ keyboard for my laptop.  I can recommend this layout for programming, and otherwise for all german/italian/french/spanish/portugese speaking users.  This layout is _very_ convenient. Costs ~15-20 €/$/£ (ex/incl. backlight, excl. shipping costs).


> Is there a way to have the laptop keyboard layout set to de, while the external USB keyboard layout is set to us?


I did not find out, too, and will set this thread on watch...


----------



## George (Jul 10, 2020)

Isn't this done in xorg.conf files?
Back in the days you had to spend so much time in those files to even get xorg starting. ;D


Or add a hotkey for a script that toggles between `setxkbmap de` and `setxkbmap en`.


----------



## Mjölnir (Jul 10, 2020)

There's a keyboard indicator in any decent GUI.  I click it, it changes the the layout from _swiss_ (internal laptop keyboard) to _german_ (external keyboard).  But this is _inconvenient_.  What we want is X11 to have a way to set the resp. layout for each keyboard.  AFAIK, it handles only _one_ layout for _all_ keyboards. EDIT: seems this is a design bug.  Would you accept e.g. cups(1) could only set one printer type for all printers connected to the system?


----------



## George (Jul 10, 2020)

This? `setxkbmap -device ..`




__





						X keyboard extension - ArchWiki
					






					wiki.archlinux.org


----------



## Mjölnir (Jul 10, 2020)

THX! Never found this.  IMHO s/o should file a bug report to KDE, it does not support this, at least not in the system config (easily).  Maybe you have to do that in xorg.conf, then the KDE _systemsettings_ shows a 2nd tab for the additional keyboard.  Which contradicts the intention to free the naive user from editing config files.


----------

