1

I have a Raspberry Pi 3, running

Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

I use LXDE. However, on reboot and login, my keymap is not properly loaded. For example, window switching via Alt-Tab does not work. It only works after I execute

sudo udevadm trigger --subsystem-match=input --action=change

or if i run raspi-config (which ends up executing udevadm)

excerpt from raspi-config:

do_configure_keyboard() {
  dpkg-reconfigure keyboard-configuration &&
  printf "Reloading keymap. This may take a short while\n" &&
  invoke-rc.d keyboard-setup start || return $?
  udevadm trigger --subsystem-match=input --action=change
  return 0

}

but if i rlog out and back in, the keymap once again isn't loaded. I have tried 2 different USB keyboards and, in each case, they are plugged in during reboot. Since my keybindings are defined in my home directory (~/.config/openbox/lxde-pi-rc.xml), I assume that the keymap should be loaded on login (not boot), but I'm not really sure of how/when the keymap binding mechanism works.

I would like to have the keybindings working on login. I could always work around the issue by running udevadm in a login script (run as root), but somehow I think the system would be designed to work without having to explicitely do that. Any help would be appreciated.

/etc/default/keyboard

# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc104"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"

excerpt from ~/.config/openbox/lxde-pi-rc.xml

<!-- Keybindings for window switching --> 
<keybind key="A-Tab">
  <action name="NextWindow"/>
</keybind>

Update:

I'm looking into the process for X->window manager->desktop (openbox/LXDE-pi) on login.

Looking at keyboard events to see what changes before/after

xev -event keyboard

upon login to LXDE environment. Pressing ALT, followed by TAB, releasing TAB, then ALT results in the following events:

KeyPress event, serial 25, synthetic NO, window 0x1e00001,
    root 0x25d, subw 0x0, time 99404308, (315,-475), root:(495,320),
    state 0x0, keycode 64 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x1e00001,
    root 0x25d, subw 0x0, time 99404744, (315,-475), root:(495,320),
    state 0x80, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XmbLookupString gives 1 bytes: (09) "   "
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x1e00001,
    root 0x25d, subw 0x0, time 99405115, (315,-475), root:(495,320),
    state 0x80, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x1e00001,
    root 0x25d, subw 0x0, time 99405158, (315,-475), root:(495,320),
    state 0x80, keycode 64 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

after executing sudo udevadm trigger --verbose --subsystem-match=input --action=change

the same key sequence creates the following events

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  93  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   0   0   0   0 

Unfortunately, I still don't understand why Keymap isn't translating the key events until after i reload the keymap with udevadm

Your Answer

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

Browse other questions tagged or ask your own question.