3

I need to be able to use two keyboards (one standard AZERTY on my laptop) and a TypeMatrix 2030 USB (BÉPO layout). This I configured fine in xorg.conf by putting the following code in xorg.conf (which I created)

Section "InputClass"
  Identifier "keyboard"
  Driver "evdev"
  Option "XkbLayout" "fr"
  Option "XkbVariant" "oss"

  MatchIsKeyboard "on"
EndSection

Section "InputClass"
  Identifier "Typematrix Bepo"
  Driver "evdev"
  Option "XkbLayout" "fr"
  Option "XkbVariant" "bepo"

  MatchVendor "TypeMatrix.com"
  MatchProduct "USB Keyboard"
  MatchIsKeyboard "on"
EndSection

The effect of this is that I can use either keyboard to login in kdm (I didn't test with lightdm), in other words everything works as I want outside KDE. Unfortunately as soon as KDE is running the DM is overriding X configuration and I'm stuck with the usual layout selector.

Is there a way to configure KDE so that either

  1. KDE does not override X settings or
  2. KDE uses more than one hardware for the keyboard (and/or allows me to associate a different layout to different keyboard)

?

Thank you for your help ! Please note that I don't want to lengthily explain why clicking on the «change layout» icon in the taskbar doesn't suit me, and more generally why it is not sufficient for me to have a single hardware keyboard recognised.

PS: (un)checking "Configure Layouts" in the System Settings has no bearing on the problem.

Configuration: Kubuntu 14.04 LTS 2 on a Sony VAIO VPCZ23M9E with TypeMatrix 2030 USB keyboard

2
  • did you find a solution? I have similar issue with en_US + Typematrix Dvorak. Modifier keys are completely misbehaving – Édouard Lopez Feb 16 '16 at 16:10
  • No, unfortunately nothing came up. I'm no linux guru myself so I'll just have to wait… – Loïc Teyssier Feb 16 '16 at 21:38
0

It's an old question, but I wanted to achieve the same as the OP and this works in KDE Plasma 5.19.

I created the following (executable) script:

#!/bin/sh
#set-keyboard-layout.sh

#when using multiple keyboards at once, KDE overrides xorg keyboard configs
#using this script in autostart can set the correct layout for one of the
#keyboards again.

KEYBD_ID="Logitech HID compliant keyboard"
KEYBD_LAYOUT="fr"
KEYBD_VARIANT="bepo"

setxkbmap -layout "$KEYBD_LAYOUT" -variant "$KEYBD_VARIANT" -device $(xinput list --id-only "$KEYBD_ID")

Change the variables to suit your needs. Use xinput list --short to find the value to for KEYBD_ID.

I then added it to KDE Autostart scripts (System Settings > Startup and Shutdown (under Workspace) > Autostart > Add script...)

It leaves the laptop keyboard layout as set in KDE, but changes the USB keyboard to its correct layout. It will probably be overridden if you manually change keyboard layouts, but rebooting or logout/login will probably fix it again.

Thanks to this and this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.