键盘布局切换组合键不起作用

键盘布局切换组合键不起作用

我使用以下选项创建了该00-keyboard.conf文件/etc/X11/xorg.conf.d/

Section "InputClass"
        Identifier "system-keyboard"
        Option "XkbLayout" "latam,ru"
    Option "XkbVariant" ",qwerty"
        Option "XkbOptions" "grp:alt_shift_toggle"
EndSection

的输出/var/log/Xorg.0.log

[    29.431] (**) HP Wireless hotkeys: Applying InputClass "system-keyboard"
[    29.431] (II) Using input driver 'evdev' for 'HP Wireless hotkeys'
[    29.431] (**) HP Wireless hotkeys: always reports core events
[    29.432] (**) evdev: HP Wireless hotkeys: Device: "/dev/input/event8"
[    29.432] (--) evdev: HP Wireless hotkeys: Vendor 0 Product 0
[    29.432] (--) evdev: HP Wireless hotkeys: Found keys
[    29.432] (II) evdev: HP Wireless hotkeys: Configuring as keyboard
[    29.432] (**) Option "config_info" "udev:/sys/devices/virtual/input/input9/event8"
[    29.432] (II) XINPUT: Adding extended input device "HP Wireless hotkeys" (type: KEYBOARD, id 15)
[    29.432] (**) Option "xkb_rules" "evdev"
[    29.432] (**) Option "xkb_model" "pc105"
[    29.432] (**) Option "xkb_layout" "latam,ru"
[    29.432] (**) Option "xkb_variant" ",qwerty"
[    29.432] (**) Option "xkb_options" "grp:alt_shift_toggle"
[   459.494] (II) intel(0): EDID vendor "LGD", prod id 902
[   459.494] (II) intel(0): Printing DDC gathered Modelines:
[   459.494] (II) intel(0): Modeline "1366x768"x0.0   76.40  1366 1402 1450 1610  768 771 776 790 +hsync -vsync (47.5 kHz eP)
[   459.494] (II) intel(0): Modeline "1366x768"x0.0   50.93  1366 1402 1450 1610  768 771 776 790 +hsync -vsync (31.6 kHz e)

这是输出localectl status

System Locale: LANG=es_CL.UTF-8
                  LANGUAGE=es_CL:es
       VC Keymap: n/a
      X11 Layout: latam
       X11 Model: pc105

按 Alt + Shift 键不会执行任何操作。我在 Debian Jessie。

然而,setxkbmap -option grp:alt_shift_toggle latam,ru按预期工作。

答案1

如果运行setxkbmap后键绑定起作用,则可以在启动会话时执行该命令。这在 Openbox 中适用于我:我已将命令包含在~/.config/openbox/autostart

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:­scroll latam,ru

当然,您可以更改按键组合。完整列表:

grep "grp:.*toggle" /usr/share/X11/xkb/rules/base.lst

并查看键盘的当前配置:

setxkbmap -print -verbose 10

相关内容