# two keyboards on Xorg[solved]

## 22decembre

This is quite hard to me, because I have posted a similar subjects few months ago but this one seemes to be the contrary of the previous one.

I have two keyboards : the first one embedded in my laptop which is an azerty. The second one is a usb typematrix keyboard.

Xorg is setup with udev. my embedded touchpad works fine. The usb mouse and keyboard need to be unplugged then plugged again to be recognized. After that, I can login.

When I look in xorg log, it never says anything about the azerty keyboard. When I log in a terminal (Ctrl+alt+F1), and make "cat /dev/input/event0" I see the keys I type. When I start konsole (kde terminal) I see nothing in "cat /dev/input/event0" when typing on the azerty but see the current keys typed on typematrix.

There's no /etc/X11/xorg.conf ,but this are the other files :

10-evdev.conf

```
Section "InputClass"

   Identifier "keyboard catchall"

   # MatchIsKeyboard "on"

   MatchDevicePath "/dev/input/event*"

   Driver "evdev"

        Option "XkbRules"  "xorg"

        Option "XkbLayout" "fr"

   #Option "XkbVariant" "oss_latin9"

EndSection
```

20-typematrix.conf

```
Section "InputClass"

        # Identifiant que l'on peut choisir soi-même

        Identifier "Typematrix Bepo"

 

        MatchIsKeyboard "on"

 

        # Le nom de périphérique correspond au nom que l'on a donné via udev

        MatchDevicePath "/dev/input/typematrix"

 

        Driver "evdev"

 

        # On choisit la disposition fr-bépo

        Option "XkbRules"  "xorg"

        Option "XkbModel"  "pc105"

        Option "XkbLayout" "fr"

        Option "XkbVariant" "bepo"

EndSection

```

30-keyboard.conf (copy from the previous one)

```
Section "InputClass"

        # Identifiant que l'on peut choisir soi-même

        Identifier "clavier standard"

 

        MatchIsKeyboard "on"

 

        # Le nom de périphérique correspond au nom que l'on a donné via udev

        MatchDevicePath "/dev/input/event*"

 

        Driver "evdev"

 

        # On choisit la disposition fr-bépo

        Option "XkbRules"  "xorg"

        Option "XkbModel"  "pc105"

        Option "XkbLayout" "fr"

EndSection

```

Xorg.0.log

```
[  1479.240] 

X.Org X Server 1.10.4

Release Date: 2011-08-19

[  1479.240] X Protocol Version 11, Revision 0

[  1479.240] Build Operating System: Linux 2.6.38-tuxonice-r1 x86_64 Gentoo

[  1479.240] Current Operating System: Linux luciole 2.6.38-tuxonice-r1 #8 SMP PREEMPT Wed Jun 22 16:17:26 CEST 2011 x86_64

[  1479.240] Kernel command line: splash=silent,theme:Twins video=uvesafb:1440x900-32 quiet root=/dev/sda9 console=tty1

[  1479.240] Build Date: 30 October 2011  11:13:07AM

[  1479.240]  

[  1479.240] Current version of pixman: 0.22.2

[  1479.240]    Before reporting problems, check http://wiki.x.org

   to make sure that you have the latest version.

[  1479.240] Markers: (--) probed, (**) from config file, (==) default setting,

   (++) from command line, (!!) notice, (II) informational,

   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

[  1479.240] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Nov 27 15:04:08 2011

[  1479.241] (==) Using config file: "/etc/X11/xorg.conf"

[  1479.241] (==) Using config directory: "/etc/X11/xorg.conf.d"

[  1479.241] (==) Using system config directory "/usr/share/X11/xorg.conf.d"

[  1479.241] (==) No Layout section.  Using the first Screen section.

[  1479.241] (**) |-->Screen "Screen0" (0)

[  1479.241] (**) |   |-->Monitor "Monitor0"

[  1479.241] (**) |   |-->Device "Device0"

[  1479.241] (**) |-->Input Device "touchpad"

[  1479.241] (**) Option "AutoAddDevices" "on"

[  1479.241] (**) Automatically adding devices

[  1479.241] (==) Automatically enabling devices

[  1479.242] (==) FontPath set to:

   /usr/share/fonts/misc/,

   /usr/share/fonts/TTF/,

   /usr/share/fonts/OTF/,

   /usr/share/fonts/Type1/,

   /usr/share/fonts/100dpi/,

   /usr/share/fonts/75dpi/

[  1479.242] (==) ModulePath set to "/usr/lib64/xorg/modules"

[  1479.242] (II) The server relies on udev to provide the list of input devices.

   If no devices become available, reconfigure udev or disable AutoAddDevices.

[  1479.242] (II) Loader magic: 0x7d7160

[  1479.242] (II) Module ABI versions:

[  1479.242]    X.Org ANSI C Emulation: 0.4

[  1479.242]    X.Org Video Driver: 10.0

[  1479.242]    X.Org XInput driver : 12.2

[  1479.242]    X.Org Server Extension : 5.0

[  1479.243] (--) PCI:*(0:1:0:0) 10de:06e9:1025:0142 rev 161, Mem @ 0xce000000/16777216, 0xd0000000/268435456, 0xcc000000/33554432, I/O @ 0x00002000/128

[  1479.243] (II) Open ACPI successful (/var/run/acpid.socket)

[  1479.243] (II) LoadModule: "extmod"

[  1479.244] (II) Loading /usr/lib64/xorg/modules/extensions/libextmod.so

[  1479.244] (II) Module extmod: vendor="X.Org Foundation"

[  1479.244]    compiled for 1.10.4, module version = 1.0.0

[  1479.244]    Module class: X.Org Server Extension

[  1479.244]    ABI class: X.Org Server Extension, version 5.0

[  1479.244] (II) Loading extension MIT-SCREEN-SAVER

[  1479.244] (II) Loading extension XFree86-VidModeExtension

[  1479.244] (II) Loading extension XFree86-DGA

[  1479.244] (II) Loading extension DPMS

[  1479.244] (II) Loading extension XVideo

[  1479.244] (II) Loading extension XVideo-MotionCompensation

[  1479.244] (II) Loading extension X-Resource

[  1479.244] (II) LoadModule: "dbe"

[  1479.245] (II) Loading /usr/lib64/xorg/modules/extensions/libdbe.so

[  1479.245] (II) Module dbe: vendor="X.Org Foundation"

[  1479.245]    compiled for 1.10.4, module version = 1.0.0

[  1479.245]    Module class: X.Org Server Extension

[  1479.245]    ABI class: X.Org Server Extension, version 5.0

[  1479.245] (II) Loading extension DOUBLE-BUFFER

[  1479.245] (II) LoadModule: "glx"

[  1479.245] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so

[  1479.262] (II) Module glx: vendor="NVIDIA Corporation"

[  1479.262]    compiled for 4.0.2, module version = 1.0.0

[  1479.262]    Module class: X.Org Server Extension

[  1479.262] (II) NVIDIA GLX Module  285.05.09  Fri Sep 23 17:51:24 PDT 2011

[  1479.262] (II) Loading extension GLX

[  1479.262] (II) LoadModule: "record"

[  1479.262] (II) Loading /usr/lib64/xorg/modules/extensions/librecord.so

[  1479.262] (II) Module record: vendor="X.Org Foundation"

[  1479.262]    compiled for 1.10.4, module version = 1.13.0

[  1479.262]    Module class: X.Org Server Extension

[  1479.262]    ABI class: X.Org Server Extension, version 5.0

[  1479.262] (II) Loading extension RECORD

[  1479.262] (II) LoadModule: "dri"

[  1479.263] (WW) Warning, couldn't open module dri

[  1479.263] (II) UnloadModule: "dri"

[  1479.263] (II) Unloading dri

[  1479.263] (EE) Failed to load module "dri" (module does not exist, 0)

[  1479.263] (II) LoadModule: "dri2"

[  1479.263] (WW) Warning, couldn't open module dri2

[  1479.263] (II) UnloadModule: "dri2"

[  1479.263] (II) Unloading dri2

[  1479.263] (EE) Failed to load module "dri2" (module does not exist, 0)

[  1479.263] (II) LoadModule: "nvidia"

[  1479.263] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so

[  1479.264] (II) Module nvidia: vendor="NVIDIA Corporation"

[  1479.264]    compiled for 4.0.2, module version = 1.0.0

[  1479.264]    Module class: X.Org Video Driver

[  1479.264] (II) LoadModule: "synaptics"

[  1479.264] (II) Loading /usr/lib64/xorg/modules/input/synaptics_drv.so

[  1479.264] (II) Module synaptics: vendor="X.Org Foundation"

[  1479.264]    compiled for 1.10.2, module version = 1.4.0

[  1479.264]    Module class: X.Org XInput Driver

[  1479.264]    ABI class: X.Org XInput driver, version 12.2

[  1479.264] (II) NVIDIA dlloader X Driver  285.05.09  Fri Sep 23 17:33:35 PDT 2011

[  1479.264] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs

[  1479.264] (++) using VT number 7

[  1479.269] (II) Loading sub module "fb"

[  1479.270] (II) LoadModule: "fb"

[  1479.270] (II) Loading /usr/lib64/xorg/modules/libfb.so

[  1479.270] (II) Module fb: vendor="X.Org Foundation"

[  1479.270]    compiled for 1.10.4, module version = 1.0.0

[  1479.270]    ABI class: X.Org ANSI C Emulation, version 0.4

[  1479.270] (II) Loading sub module "wfb"

[  1479.270] (II) LoadModule: "wfb"

[  1479.270] (II) Loading /usr/lib64/xorg/modules/libwfb.so

[  1479.271] (II) Module wfb: vendor="X.Org Foundation"

[  1479.271]    compiled for 1.10.4, module version = 1.0.0

[  1479.271]    ABI class: X.Org ANSI C Emulation, version 0.4

[  1479.271] (II) Loading sub module "ramdac"

[  1479.271] (II) LoadModule: "ramdac"

[  1479.271] (II) Module "ramdac" already built-in

[  1479.271] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so

[  1479.271] (II) Loading /usr/lib64/xorg/modules/libwfb.so

[  1479.271] (II) Loading /usr/lib64/xorg/modules/libfb.so

[  1479.271] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32

[  1479.271] (==) NVIDIA(0): RGB weight 888

[  1479.271] (==) NVIDIA(0): Default visual is TrueColor

[  1479.271] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)

[  1479.876] (II) NVIDIA(GPU-0): Display (AUO (DFP-0)) does not support NVIDIA 3D Vision

[  1479.876] (II) NVIDIA(GPU-0):     stereo.

[  1479.878] (II) NVIDIA(0): NVIDIA GPU GeForce 9300M GS (G98) at PCI:1:0:0 (GPU-0)

[  1479.878] (--) NVIDIA(0): Memory: 524288 kBytes

[  1479.878] (--) NVIDIA(0): VideoBIOS: 62.98.51.00.06

[  1479.878] (II) NVIDIA(0): Detected PCI Express Link width: 16X

[  1479.878] (--) NVIDIA(0): Interlaced video modes are supported on this GPU

[  1479.878] (--) NVIDIA(0): Connected display device(s) on GeForce 9300M GS at PCI:1:0:0

[  1479.878] (--) NVIDIA(0):     AUO (DFP-0)

[  1479.878] (--) NVIDIA(0): AUO (DFP-0): 330.0 MHz maximum pixel clock

[  1479.878] (--) NVIDIA(0): AUO (DFP-0): Internal Dual Link LVDS

[  1479.880] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID has been

[  1479.880] (**) NVIDIA(0):     enabled on all display devices.

[  1479.929] (II) NVIDIA(0): Assigned Display Device: DFP-0

[  1479.929] (WW) NVIDIA(0): No valid modes for "1280x800"; removing.

[  1479.929] (II) NVIDIA(0): Validated modes:

[  1479.929] (II) NVIDIA(0):     "1440x900"

[  1479.929] (II) NVIDIA(0):     "800x600"

[  1479.929] (II) NVIDIA(0):     "640x480"

[  1479.929] (II) NVIDIA(0): Virtual screen size determined to be 1440 x 900

[  1480.980] (--) NVIDIA(0): DPI set to (98, 99); computed from "UseEdidDpi" X config

[  1480.980] (--) NVIDIA(0):     option

[  1480.980] (--) Depth 24 pixmap format is 32 bpp

[  1480.980] (II) NVIDIA: Using 768.00 MB of virtual memory for indirect memory access.

[  1480.987] (II) NVIDIA(0): Setting mode "1440x900"

[  1481.284] (II) Loading extension NV-GLX

[  1481.318] (==) NVIDIA(0): Disabling shared memory pixmaps

[  1481.318] (==) NVIDIA(0): Backing store disabled

[  1481.318] (==) NVIDIA(0): Silken mouse enabled

[  1481.319] (**) NVIDIA(0): DPMS enabled

[  1481.319] (II) Loading extension NV-CONTROL

[  1481.319] (II) Loading extension XINERAMA

[  1481.319] (II) Loading sub module "dri2"

[  1481.319] (II) LoadModule: "dri2"

[  1481.320] (WW) Warning, couldn't open module dri2

[  1481.320] (II) UnloadModule: "dri2"

[  1481.320] (II) Unloading dri2

[  1481.320] (EE) NVIDIA: Failed to load module "dri2" (module does not exist, 0)

[  1481.320] (II) NVIDIA(0): The X server will not be able to send the VDPAU driver name to

[  1481.320] (II) NVIDIA(0):     libvdpau.

[  1481.320] (==) RandR enabled

[  1481.320] (II) Initializing built-in extension Generic Event Extension

[  1481.320] (II) Initializing built-in extension SHAPE

[  1481.320] (II) Initializing built-in extension MIT-SHM

[  1481.320] (II) Initializing built-in extension XInputExtension

[  1481.320] (II) Initializing built-in extension XTEST

[  1481.320] (II) Initializing built-in extension BIG-REQUESTS

[  1481.320] (II) Initializing built-in extension SYNC

[  1481.320] (II) Initializing built-in extension XKEYBOARD

[  1481.320] (II) Initializing built-in extension XC-MISC

[  1481.320] (II) Initializing built-in extension XINERAMA

[  1481.320] (II) Initializing built-in extension XFIXES

[  1481.320] (II) Initializing built-in extension RENDER

[  1481.320] (II) Initializing built-in extension RANDR

[  1481.320] (II) Initializing built-in extension COMPOSITE

[  1481.320] (II) Initializing built-in extension DAMAGE

[  1481.322] (II) Initializing extension GLX

[  1481.438] (II) Using input driver 'synaptics' for 'touchpad'

[  1481.438] (II) Loading /usr/lib64/xorg/modules/input/synaptics_drv.so

[  1481.438] (**) touchpad: always reports core events

[  1481.519] (--) touchpad auto-dev sets device to /dev/input/event6

[  1481.535] (**) Option "Device" "/dev/input/event6"

[  1481.575] (--) touchpad: x-axis range 1472 - 5472

[  1481.575] (--) touchpad: y-axis range 1408 - 4448

[  1481.575] (--) touchpad: pressure range 0 - 255

[  1481.575] (--) touchpad: finger width range 0 - 15

[  1481.575] (--) touchpad: buttons: left right scroll-buttons

[  1481.575] (**) Option "TapButton1" "1"

[  1481.575] (**) Option "TapButton2" "2"

[  1481.575] (**) Option "TapButton3" "3"

[  1481.607] (--) touchpad: touchpad found

[  1481.607] (**) touchpad: always reports core events

[  1481.623] (II) XINPUT: Adding extended input device "touchpad" (type: TOUCHPAD)

[  1481.623] (**) touchpad: (accel) MinSpeed is now constant deceleration 2.5

[  1481.623] (**) touchpad: MaxSpeed is now 1.75

[  1481.623] (**) touchpad: AccelFactor is now 0.040

[  1481.623] (**) touchpad: (accel) keeping acceleration scheme 1

[  1481.623] (**) touchpad: (accel) acceleration profile 1

[  1481.623] (**) touchpad: (accel) acceleration factor: 2.000

[  1481.623] (**) touchpad: (accel) acceleration threshold: 4

[  1481.647] (--) touchpad: touchpad found

[  1488.140] (II) config/udev: Adding input device USB Optical Mouse (/dev/input/event7)

[  1488.140] (**) USB Optical Mouse: Applying InputClass "evdev pointer catchall"

[  1488.140] (**) USB Optical Mouse: Applying InputClass "keyboard catchall"

[  1488.140] (II) LoadModule: "evdev"

[  1488.140] (II) Loading /usr/lib64/xorg/modules/input/evdev_drv.so

[  1488.141] (II) Module evdev: vendor="X.Org Foundation"

[  1488.141]    compiled for 1.10.2, module version = 2.6.0

[  1488.141]    Module class: X.Org XInput Driver

[  1488.141]    ABI class: X.Org XInput driver, version 12.2

[  1488.141] (II) Using input driver 'evdev' for 'USB Optical Mouse'

[  1488.141] (II) Loading /usr/lib64/xorg/modules/input/evdev_drv.so

[  1488.141] (**) USB Optical Mouse: always reports core events

[  1488.141] (**) USB Optical Mouse: Device: "/dev/input/event7"

[  1488.146] (--) USB Optical Mouse: Found 9 mouse buttons

[  1488.146] (--) USB Optical Mouse: Found scroll wheel(s)

[  1488.146] (--) USB Optical Mouse: Found relative axes

[  1488.146] (--) USB Optical Mouse: Found x and y relative axes

[  1488.146] (II) USB Optical Mouse: Configuring as mouse

[  1488.146] (II) USB Optical Mouse: Adding scrollwheel support

[  1488.146] (**) USB Optical Mouse: YAxisMapping: buttons 4 and 5

[  1488.146] (**) USB Optical Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200

[  1488.146] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2.2/2-2.2:1.0/input/input39/event7"

[  1488.146] (II) XINPUT: Adding extended input device "USB Optical Mouse" (type: MOUSE)

[  1488.146] (II) USB Optical Mouse: initialized for relative axes.

[  1488.146] (**) USB Optical Mouse: (accel) keeping acceleration scheme 1

[  1488.146] (**) USB Optical Mouse: (accel) acceleration profile 0

[  1488.146] (**) USB Optical Mouse: (accel) acceleration factor: 2.000

[  1488.146] (**) USB Optical Mouse: (accel) acceleration threshold: 4

[  1488.147] (II) config/udev: Adding input device USB Optical Mouse (/dev/input/mouse1)

[  1488.147] (II) No input driver/identifier specified (ignoring)

[  1488.364] (II) config/udev: Adding input device TypeMatrix.com USB Keyboard (/dev/input/typematrix)

[  1488.364] (**) TypeMatrix.com USB Keyboard: Applying InputClass "Typematrix Bepo"

[  1488.364] (II) Using input driver 'evdev' for 'TypeMatrix.com USB Keyboard'

[  1488.364] (II) Loading /usr/lib64/xorg/modules/input/evdev_drv.so

[  1488.364] (**) TypeMatrix.com USB Keyboard: always reports core events

[  1488.364] (**) TypeMatrix.com USB Keyboard: Device: "/dev/input/typematrix"

[  1488.366] (--) TypeMatrix.com USB Keyboard: Found keys

[  1488.366] (II) TypeMatrix.com USB Keyboard: Configuring as keyboard

[  1488.366] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2.4/2-2.4:1.1/input/input41/event9"

[  1488.366] (II) XINPUT: Adding extended input device "TypeMatrix.com USB Keyboard" (type: KEYBOARD)

[  1488.366] (**) Option "xkb_rules" "evdev"

[  1488.366] (**) Option "xkb_model" "pc105"

[  1488.366] (**) Option "xkb_layout" "fr"

[  1488.366] (**) Option "xkb_variant" "bepo"

[  1488.394] (II) config/udev: Adding input device TypeMatrix.com USB Keyboard (/dev/input/typematrix)

[  1488.394] (**) TypeMatrix.com USB Keyboard: Applying InputClass "Typematrix Bepo"

[  1488.394] (II) Using input driver 'evdev' for 'TypeMatrix.com USB Keyboard'

[  1488.394] (II) Loading /usr/lib64/xorg/modules/input/evdev_drv.so

[  1488.394] (**) TypeMatrix.com USB Keyboard: always reports core events

[  1488.394] (**) TypeMatrix.com USB Keyboard: Device: "/dev/input/typematrix"

[  1488.396] (WW) TypeMatrix.com USB Keyboard: device file is duplicate. Ignoring.

[  1488.399] (EE) PreInit returned 8 for "TypeMatrix.com USB Keyboard"

[  1488.399] (II) UnloadModule: "evdev"

[  1488.399] (II) Unloading evdev

```

----------

## VoidMage

Given there's no 'event0' in this log, I'd suspect your udev rules have messed things up.

----------

## 22decembre

Maybe, but the /dev/input/event0 file exist ! So ?

Do you think too that udev is wrong starting up as it need to be unplugged and plugged again ?

----------

## VoidMage

 :Rolling Eyes:  Let me be more clear: 

- what custom rules did you add ?

- what does 'udevadm info -q all -n input/event0' print (and are you sure that event0 is that keyboard) ?

----------

## 22decembre

Thanks for helping.

I added the rule typematrix.rules in this list :

```
9:06 root@luciole /etc/udev/rules.d # ll

total 252K

-rw-r--r-- 1 root root  90K  9 déc.   2010 41-libsane.rules

-rw-r--r-- 1 root root  76K 29 juin  20:07 65-mtp.rules

-rw-r--r-- 1 root root 1,4K  4 déc.   2010 70-persistent-cd.rules

-rw-r--r-- 1 root root  813  4 oct.  18:56 70-persistent-net.rules

-rw-r--r-- 1 root root 3,2K 21 mars   2011 77-mm-ericsson-mbm.rules

-rw-r--r-- 1 root root  11K 21 mars   2011 77-mm-longcheer-port-types.rules

-rw-r--r-- 1 root root  379 21 mars   2011 77-mm-pcmcia-device-blacklist.rules

-rw-r--r-- 1 root root  510 21 mars   2011 77-mm-platform-serial-whitelist.rules

-rw-r--r-- 1 root root  975 21 mars   2011 77-mm-simtech-port-types.rules

-rw-r--r-- 1 root root 3,0K 21 mars   2011 77-mm-usb-device-blacklist.rules

-rw-r--r-- 1 root root 1,2K 21 mars   2011 77-mm-x22x-port-types.rules

-rw-r--r-- 1 root root 9,3K 21 mars   2011 77-mm-zte-port-types.rules

-rw-r--r-- 1 root root  284 21 mars   2011 77-nm-olpc-mesh.rules

-rw-r--r-- 1 root root  667 21 mars   2011 80-mm-candidate.rules

-rw-r--r-- 1 root root   28  5 déc.   2010 99-fuse.rules

-rw-r--r-- 1 root root   51 27 févr.  2011 99-ntfs3g.rules

-rw-r--r-- 1 root root   68  5 oct.  20:28 typematrix.rules

```

which is :

```
ATTRS{name}=="TypeMatrix.com USB Keyboard", NAME="input/typematrix"
```

```
9:07 root@luciole /etc/udev/rules.d # udevadm info -q all -n input/event0

P: /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0/event0

N: input/event0

S: char/13:64

E: UDEV_LOG=3

E: DEVPATH=/devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0/event0

E: MAJOR=13

E: MINOR=64

E: DEVNAME=/dev/input/event0

E: SUBSYSTEM=input

E: ID_INPUT=1

E: DMI_VENDOR=Acer, inc.

E: DEVLINKS=/dev/char/13:64

```

I am not absolutely sure event0 is my embedded keyboard as there's 10 event files, but when I look in that file with cat (or any other event file) it print me the letter printed on the keyboard (with the rigth keymap !), but in a terminal. That sentence may not be clear, I hope to be understood…

```
9:08 root@luciole /dev/input # ll

total 0

drwxr-xr-x 2 root root    140 28 nov.  07:38 by-id/

drwxr-xr-x 2 root root    200 28 nov.  07:38 by-path/

crw-r----- 1 root root 13, 64 28 nov.  07:37 event0

crw-r----- 1 root root 13, 65 28 nov.  07:37 event1

crw-r----- 1 root root 13, 74 28 nov.  07:37 event10

crw-r----- 1 root root 13, 75 28 nov.  07:37 event11

crw-r----- 1 root root 13, 66 28 nov.  07:37 event2

crw-r----- 1 root root 13, 67 28 nov.  07:37 event3

crw-r----- 1 root root 13, 68 28 nov.  07:37 event4

crw-r----- 1 root root 13, 69 28 nov.  07:37 event5

crw-r----- 1 root root 13, 70 28 nov.  07:37 event6

crw-r----- 1 root root 13, 71 28 nov.  07:38 event7

crw-r----- 1 root root 13, 63 28 nov.  07:37 mice

crw-r----- 1 root root 13, 32 28 nov.  07:37 mouse0

crw-r----- 1 root root 13, 33 28 nov.  07:38 mouse1

crw-r----- 1 root root 13, 72 28 nov.  07:38 typematrix

```

----------

## VoidMage

First of all, instead of 'NAME=' use 'SYMLINK+=' (and most likely the proper solution is 'TAG+=' anyway).

What's your udev version anyway ? Not only what seems to me your embedded keyboard isn't getting tagged as one, but any recent udev should print you a warning for your rule.

On that note: what's the same output for that typematrix keyboard ?

----------

## 22decembre

sys-fs/udev-164-r2 was built with the following:

USE="(consolekit) extras (multilib) (policykit) -build (-selinux) -test"

```
9:08 root@luciole /dev/input # udevadm info -q all -n input/typematrix 

P: /devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2.4/2-2.4:1.0/input/input13/event8

N: input/typematrix

S: char/13:72

S: input/by-id/usb-TypeMatrix.com_USB_Keyboard-event-kbd

S: input/by-path/pci-0000:00:1d.7-usb-0:2.4:1.0-event-kbd

E: UDEV_LOG=3

E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2.4/2-2.4:1.0/input/input13/event8

E: MAJOR=13

E: MINOR=72

E: DEVNAME=/dev/input/typematrix

E: SUBSYSTEM=input

E: ID_INPUT=1

E: ID_INPUT_KEY=1

E: ID_INPUT_KEYBOARD=1

E: ID_VENDOR=TypeMatrix.com

E: ID_VENDOR_ENC=TypeMatrix.com

E: ID_VENDOR_ID=1e54

E: ID_MODEL=USB_Keyboard

E: ID_MODEL_ENC=USB\x20Keyboard

E: ID_MODEL_ID=2030

E: ID_REVISION=0130

E: ID_SERIAL=TypeMatrix.com_USB_Keyboard

E: ID_TYPE=hid

E: ID_BUS=usb

E: ID_USB_INTERFACES=:030101:030100:

E: ID_USB_INTERFACE_NUM=00

E: ID_USB_DRIVER=usbhid

E: ID_PATH=pci-0000:00:1d.7-usb-0:2.4:1.0

E: DEVLINKS=/dev/char/13:72 /dev/input/by-id/usb-TypeMatrix.com_USB_Keyboard-event-kbd /dev/input/by-path/pci-0000:00:1d.7-usb-0:2.4:1.0-event-kbd

```

----------

## VoidMage

If I'm reading your output correctly, what's the content of /sys/devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0/capabilities/{ev,key} ?

----------

## 22decembre

ev contains "21" and key "0"

I am not a specialist of udev, so I thank you for your help. What sort of warning do udev would say me ? where to find the warning ?

----------

## 22decembre

I changed the "NAME" into "SYMLINK+" and everything breaks ! The typematrix was with an azerty map. So painful ! I get into terminal and reverted back to the previous rule.

I tested also the azerty keyboard and nothing changed on it !

----------

## VoidMage

 :Rolling Eyes:  I've never said it will be as simple as just replacing one with the other.

You need to adjust xorg conf snippets - that's why I've said 'TAG+=' will most likely be the proper solution, as then 'MatchTag' can be used, otherwise perhaps MatchProduct (combined with MatchIsKeyboard, obviously) could be used.

But getting back to the embedded keyboard, that content seems wrong (compare it with similar for usb keyboard).

I don't consider myself an udev (or - in this case - more like kernel) expert, but it seems that your kernel doesn't consider that keyboard to be a keyboard. Are you sure you've configured it correctly for a laptop ? If you are, make sure, that event0 is indeed the keyboard.

----------

## 22decembre

Maybe it's harder of course, but any thing we have to diagnose is better. The keyboard worked for years like this, so, I think I am right, but you can give me ways to search ! I don't know what to look for in kernel config. I didn't change my kernel since half a year.

----------

## VoidMage

First, check other event devices with 'udevadm info' to see if possibly a different one is that keyboard.

The /sys paths are in that output. As I said, just compare it with the usb keyboard - while not same, content of {ev,keys} files should be similar.

I don't have a laptop, so I can't really say what would be the proper options, but a pastebin of your kernel config could help somebody that does.

----------

## 22decembre

first, event5 looks like an embedded keyboard :

```
22:27 root@luciole /home/stephane # udevadm info -q all -n input/event5 

P: /devices/platform/i8042/serio0/input/input5/event5

N: input/event5

S: char/13:69

S: input/by-path/platform-i8042-serio-0-event-kbd

E: UDEV_LOG=3

E: DEVPATH=/devices/platform/i8042/serio0/input/input5/event5

E: MAJOR=13

E: MINOR=69

E: DEVNAME=/dev/input/event5

E: SUBSYSTEM=input

E: ID_INPUT=1

E: ID_INPUT_KEY=1

E: ID_INPUT_KEYBOARD=1

E: ID_SERIAL=noserial

E: ID_PATH=platform-i8042-serio-0

E: DMI_VENDOR=Acer, inc.

E: DEVLINKS=/dev/char/13:69 /dev/input/by-path/platform-i8042-serio-0-event-kbd

```

it's a kbd, with Acer Inc (my laptop is an Acer), in «platform» (where I find things like the battery) and it's the only one that is said to be a kbd appart from the typematrix.

But, adding it to xorg 40-keyboard.conf makes nothing !

the ev and key files of the event5 don't have the same output as the usb ! This is really strange !

----------

## VoidMage

 :Rolling Eyes:  'similar'!='same'.

I still suspect your udev rule disagrees either with evdev driver or xserver itself.

On that note, I need to make sure: typematrix.rules is the only rule created/modified by you, right ?

----------

## 22decembre

I don't remember any other rule udev I added ! Maybe I should backup udev directory and then erase + reinstall so I "restart" on an clear basis !?…

----------

## VoidMage

 *22decembre wrote:*   

> I don't remember any other rule udev I added !…

 

OK, for the moment lets assume 'no'.

Let's try dropping your rule completely for the moment - unplug that usb keyboard, to make sure the node is removed.

Just checking: you do know xorg conf snippets are incremental, that is latest rule that matches wins ?

Now, for their content:

as repeatably stated, setting  XkbRules for evdev driver is pointless, as it hardcodes the value.

Only MatchDevicePath worth staying is "/dev/input/event*".

To make sure 'bepo' variant is set only on the usb keyboard, make sure 20-typematrix.conf is the last keyboard snippet parsed and check with 'udevadm info -a' both keyboard nodes for values that can be used to distinguish them.

----------

## 22decembre

I have just done few things...

I moved the typematrix.rules outside the udev directory and set typematrix.conf to be 45-... so it comes AFTER the 40-keyboard.conf xorg rule.

Then I tried reboot -> still no keyboard in X. There was 9 event files in /dev/input from event0 to event8.

Then I plugged my usb keyboard. There was after that 3 more event files : event9, 10 and 11. At that time, the usb keyboard worked in X, but with the wrong keymap ! (event9 is my optical mouse).

Then I moved all udev rules outside and reinstall udev with an emerge -1 udev. And restart X. And now the embedded keyboard works out of the box. Plus, the usb keyboard works without need to be unplugged/plugged again !

So, I wish to say you thank you ! This was clearly a udev problem. Now, I just want to have my usb keyboard have the correct keymap in X, I assume it consists of writing a correct rule for udev. Can you give me some advice ? Do you need some precisions ?

----------

## VoidMage

To be honest I didn't advise the complete removal of the rules, as some of them are provided by packages other than udev, i.e. 99-fuse or 99-ntfs3g. I'm quite doubtful you've managed to remove only the rules, that were your own.

I'm nearly certain, there's no need to add an udev rule, as long as you pay attention to the order of snippets.

As I've said, check the keyboard nodes with 'udevadm info -a', then read "InputClass" section of man xorg.conf'.

----------

## 22decembre

Don't be affraid, I have put them in a directory to recover them.

I have put this in my 45-typematrix.conf xorg conf :

```
Section "InputClass"

        # Identifiant que l'on peut choisir soi-même

        Identifier "Typematrix Bepo"

 

        MatchIsKeyboard "on"

 

        # Le nom de périphérique correspond au nom que l'on a donné via udev

        MatchDevicePath "/dev/input/event10"

 

        Driver "evdev"

 

        # On choisit la disposition fr-bépo

        Option "XkbRules"  "xorg"

        Option "XkbModel"  "pc105"

        Option "XkbLayout" "fr"

        Option "XkbVariant" "bepo"

EndSection

```

Not sure if I got the really real usb typematrix keyboard as they are two (event10 and 11) but it works now fine both ! Thanks.

----------

## VoidMage

'MatchDevicePath "/dev/input/event10"' is definitely wrong in the long run - the number of the node depends on the order of discovery, so it can change if you were to plug in a different input device.

That's why I sent you to 'udevadm info -a' and the manpage.

----------

## 22decembre

Again, you are right.

But, I have just understood one thing : when plugging the usb keyboard (or at the startup), udev can create several device files !

Actually, I use a usb hub with several things on it (the mouse, the keyboard, the bluray player...) so when I want to get the computer out, I need just one cable to unplug (plus the AC adaptator, the eth, the sound...).

So, when I plug the usb hub, udev create many device files, one is the real keyboard, one other is just the hub udev sees as keyboard, one other again the hub udev sees as mouse...

And so, don't know what to do...

I will try to write on a file all the paths in the /dev and /sys and look at their ev/key content. Now, it's time to bed ! 2 Am in Paris... See you.

----------

## 22decembre

So, I have checked. Quite hard actually ! Sorry for the long post !

My internal keyboard have ev = 120013 and key = 10000 c020000000000 0 0 700f02000003 3803078f830f401 febfffdfffefffff fffffffffffffffe

My usb keyboard (currently file event8 and event7) have ev = 1f and key = 837fff002c3027 bf00444400000000 1 f848b27c000 667bfad941dfed 9e000000000000 0 for 

event8 ; for event7 I have ev = 120013 and key = 1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe.

To my mind this mean the actual current keyboard is the event7.

After that, I paste the return of udevadm info -a --name /dev/input/event7 or 8 in text files and made diff ...

```
14:31 stephane@luciole ~/Documents $ diff clavier8 clavier7

1,2c1,2

< looking at device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input8/event8':

<     KERNEL=="event8"

---

> looking at device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input7/event7':

>     KERNEL=="event7"

6,7c6,7

<   looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input8':

<     KERNELS=="input8"

---

>   looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input7':

>     KERNELS=="input7"

11c11

<     ATTRS{phys}=="usb-0000:00:1d.0-1/input1"

---

>     ATTRS{phys}=="usb-0000:00:1d.0-1/input0"

13c13

<     ATTRS{modalias}=="input:b0003v1E54p2030e0110-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B1,B2,B5,B6,CE,CF,D0,D1,D2,D5,D8,D9,D

B,DF,E2,E7,E8,E9,EA,EB,100,162,166,16A,16E,178,179,17A,17B,17C,17D,17F,180,181,182,185,18C,18D,192,193,195,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1

AC,1AD,1AE,1B0,1B1,1B7,r6,a20,m4,lsfw"

---

>     ATTRS{modalias}=="input:b0003v1E54p2030e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw"

16,17c16,17

<   looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1':

<     KERNELS=="6-1:1.1"

---

>   looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0':

>     KERNELS=="6-1:1.0"

20c20

<     ATTRS{bInterfaceNumber}=="01"

---

>     ATTRS{bInterfaceNumber}=="00"

25,26c25,26

<     ATTRS{bInterfaceProtocol}=="00"

<     ATTRS{modalias}=="usb:v1E54p2030d0130dc00dsc00dp00ic03isc01ip00"

---

>     ATTRS{bInterfaceProtocol}=="01"

>     ATTRS{modalias}=="usb:v1E54p2030d0130dc00dsc00dp00ic03isc01ip01"
```

This looks really similar, appart the modalias (and the input / ID the kernel gives ... but we can't rely on it as you said !).

Should I create a rule like this :

```
ATTRS{modalias}=="usb:v1E54p2030d0130dc00dsc00dp00ic03isc01ip01", SYMLINK+="input/typematrix"
```

 ... ?

----------

## VoidMage

 *22decembre wrote:*   

> Should I create a rule like this :
> 
> ```
> 
> ATTRS{modalias}=="usb:v1E54p2030d0130dc00dsc00dp00ic03isc01ip01", SYMLINK+="input/typematrix"
> ...

 

 :Rolling Eyes:  No, I've meant differences between the keyboards, not various parts of the keyboard.

Post differences between those two with ev="120013".

Either MatchIsKeyboard will filter the other one out or it won't matter anyway - AFAIU (from looking at /usr/include/linux/input.f),

the other one doesn't send even keyboard scancodes (does that keyboard have a touchpad or perhaps something to generate scroll events ?).

On semi-related note: put a line break or two in that code block - it's a bit annoying, if it's that wide.

----------

## 22decembre

So, for the usb keyboard, I could use the ATTRS{idProduct}=="2030" ATTRS{bcdDevice}=="0130" ... ?

Do I need to make a special rule for the embedded keyboard too ?

----------

## VoidMage

Read 'man xorg.conf' first and see if you can manage to use one of the standard matches, before you start toying with udev rules.

----------

## 22decembre

I think I get the solution. Quite simply in fact !

I use the MatchUSBID "1e54:2030" => given by lsusb ; in 45-typematrix.conf xorg file.

I have the correct keymap in X for usb keyboard and embedded. Maybe I could even remove the udev rule I added few days ago.

----------

