NomadBSD death key if Auto Login is enabled

I have this strange problem on my laptop.

If in the Display manage settings I set the Auto Login checkbox the Ctrl-\ keys combination doesn’t work in the Italian keyboard.

Running xev, when I press Ctrl-\ I have:

KeyPress event, serial 48, synthetic NO, window 0x2e00001,
    root 0x155, subw 0x0, time 63651, (116,6), root:(207,261),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

FocusOut event, serial 48, synthetic NO, window 0x2e00001,
    mode NotifyGrab, detail NotifyAncestor

FocusOut event, serial 48, synthetic NO, window 0x2e00001,
    mode NotifyUngrab, detail NotifyPointer

FocusIn event, serial 48, synthetic NO, window 0x2e00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 48, synthetic NO, window 0x0,
    keys:  85  0   0   0   32  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 48, synthetic NO, window 0x2e00001,
    root 0x155, subw 0x0, time 64704, (116,6), root:(207,261),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

where the backslash key in not recognized.

If I do not enable the Auto Login feature the Ctrl-\ key combination works as expected and the backslash key is recognized; running xev:

KeyPress event, serial 48, synthetic NO, window 0x3c00001,
    root 0x155, subw 0x0, time 2428896, (1198,72), root:(1199,122),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 48, synthetic NO, window 0x3c00001,
    root 0x155, subw 0x0, time 2429248, (1198,72), root:(1199,122),
    state 0x4, keycode 49 (keysym 0x5c, backslash), same_screen YES,
    XLookupString gives 1 bytes: (1c) ""
    XmbLookupString gives 1 bytes: (1c) ""
    XFilterEvent returns: False

KeyRelease event, serial 48, synthetic NO, window 0x3c00001,
    root 0x155, subw 0x0, time 2429391, (1198,72), root:(1199,122),
    state 0x4, keycode 49 (keysym 0x5c, backslash), same_screen YES,
    XLookupString gives 1 bytes: (1c) ""
    XFilterEvent returns: False

KeyRelease event, serial 48, synthetic NO, window 0x3c00001,
    root 0x155, subw 0x0, time 2429453, (1198,72), root:(1199,122),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Regards
Maurizio

Are you running xorg-server>=1.20?

Yes,

> Xorg -version                                       14:13:44

X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 12.1-RELEASE-p4 amd64 
Current Operating System: FreeBSD NomadBSD 12.1-RELEASE-p5 FreeBSD 12.1-RELEASE-p5 GENERIC amd64
Build Date: 05 May 2020  01:10:17AM
 
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.

Have you adjusted your xorg input settings to libinput, yet?

No, I have only upgraded my ports and the base system.

  1. Add kern.evdev.rcpt_mask=6 to /etc/sysctl.conf.
  2. Remove the line Option "AutoAddDevices" "off" from /usr/local/etc/X11/xorg.conf.d/server-flags.conf.
  3. Install x11-drivers/xf86-input-libinput and x11/libinput.
  4. Change your /usr/local/etc/X11/xorg.conf.d/10-input-keyboard.conf to:
Section "InputClass"
    Identifier      "Keyboard0"
    MatchIsKeyboard "on"
    MatchDevicePath "/dev/input/event*"
    Driver          "libinput"
    Option          "XkbRules"   "evdev"
    Option          "XkbLayout"  "YOURLAYOUT"
    Option          "XkbVariant" "YOURKBDVARIANT"
    Option          "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Hi @mk1,

thank you very much for your support, but the laptop with Xorg & udev doesn’t work: when I press the up arrow it takes a screenshot, the touchpad keys are wrongly mapped, practically it is unusable.

This isn’t a NomadBSD error, but a FreeBSD issue, in the FreeBSD forum there are a lots of threads about this topic. If I find a solution I’ll post here.

This is due to the fact we used keycodes (which changed) in ~/.xbindkeysrc. Replace them by their symbolic names as we did here

OK, with your suggestion the laptop is more usable. Only
kern.evdev.rcpt_mask=3
is different from your instructions, but probably because sysmouse is set somewhere.

But the main problem is still here: if Auto Login is enabled the Ctrl-\ and now the Up keys don’t work.

xbindkeys is responsible, but I don’t know why it behaves like that. You can run pkill -HUP xbindkeys, and your keys should work as expected.

It solves partially the issue: the Up key works, but the Ctrl-\ doesn’t work.
Thank you again for the support.

Make a setxkbmap -rules evdev -layout it autostart entry in DSBAutostart before the xbindkeys command.

Update:
In order to make sure setxkbmap has completed before running xbindkeys, combine both command as follows:

(setxkbmap -rules evdev -layout it; xbindkeys)
1 Like

Thank you @mk1 it works!
The command I use is a bit different than your because I don’t like two copies of xbindkeys running:

(setxkbmap -rules evdev -layout it; pkill xbindkeys; xbindkeys)

Regards