Re: libinput recognizies my keyboard, but not its arrow keys

From: Michael Gmelin <freebsd_at_grem.de>
Date: Mon, 29 Jan 2024 22:17:13 UTC

> On 29. Jan 2024, at 22:05, William Bulley <web@umich.edu> wrote:
> 
> According to Michael Gmelin <freebsd@grem.de> on Mon, 01/29/24 at 15:38:
>> 
>> It's always a bit hard to support remotely, hence my questions to be
>> crystal clear what you tried.
> 
> You've been very clear and I thank you from the bottom of my heart!!
> 
> Too bad I can't buy you a beer!
> 
>> This is what I use in in /usr/local/etc/X11/xorg.conf.d/99-myinput.conf:
>> 
>> Section "InputClass"
>>        Identifier "libinput keyboard catchall"
>>        MatchIsKeyboard "on"
>>        MatchDevicePath "/dev/input/event*"
>>        Driver "libinput"
>>        Option "XkbRules" "evdev"
>> #       Option "Ignore" "on"
>> EndSection
>> 
>> Section "InputClass"
>>        Identifier "libinput touchpad catchall"
>>        MatchIsTouchpad "on"
>>        MatchDevicePath "/dev/input/event*"
>>        Driver "libinput"
>>        Option "MiddleEmulation" "on"
>>        Option "DisableWhileTyping" "off"
>> EndSection
>> 
>> (the touchpad section is probably not what you need).
>> 
>> So maybe - as a last "simple" solution, you could try:
>> 
>>  setxkbmap -model pc105 -layout us
>> 
>> in your .xinitrc and place 99-myinput.conf from above as the only
>> xorg configuration in /usr/local/etc/X11/xorg.conf.d/
> 
> Well I did both of those things, and, for some crazy reason it
> worked!  My keyboard's arrow keys now work!!!
> 
> To be completely honest, I only altered the keyboard section of
> the file in my /usr/local/etc/X11/xorg.conf.d/ leaving the mouse
> section and the graphics card "Device" section alone.
> 
> Here is the new "keyboard" section in my configuration file:
> 
>  Section "InputClass"
>        Identifier "libinput keyboard catchall"
>        MatchIsKeyboard "on"
>        MatchDevicePath "/dev/input/event*"
>        Driver "libinput"
>        Option "XkbRules" "evdev"
>  EndSection
> 
> My understanding was the contents of the "Identifier" line
> did not matter -- anything could be put there.  I had this:
> 
>   Identifier      "Keyboard0"
> 
> I have the MatchIsKeyboard line and the Driver line, so it
> must be that the key (no pun intended) addition to that
> section is that MatchDevicePath line.  Who knew?!?!?
> 
> Maybe the Option line is important, too, but that is
> something I can check later.  You are a life saver!!!
> 

If I remember correctly, setting XkbRules actually matters, as it affects keyboard rule composition. It should also be possible to pass it in the `-rules` parameter to setxkbmap (personally, I’m trying to configure as much as possible in my ~/.xinitrc, as it makes setting up new environments quite easy and is part of my home directory backup).

> I don't know how to thank you enough!!!  Thanks!  Thanks!

I’m really happy to hear that - having your keyboard work properly is essential.

Cheers
Michael