AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 983872
Accepted
JellicleCat
JellicleCat
Asked: 2017-12-07 10:41:20 +0800 CST2017-12-07 10:41:20 +0800 CST 2017-12-07 10:41:20 +0800 CST

evdev ButtonMapping 记录正常但没有效果

  • 772

Ignore 命令有效,但 ButtonMapping 无效。

我创建了一个文件/usr/share/X11/xorg.conf.d/39-myinput.com:

Section "InputClass"
        Identifier "Apple MagicKeyboard"
        MatchIsKeyboard "on"
        MatchProduct "Magic Keyboard"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "Ignore" "off"
        Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0"
EndSection

此时我只是在测试 ButtonMapping,但它似乎没有任何效果。你能为我指出正确的方向吗?

我曾经evtest确定键 16 和 17 是Qand W:

Event: time 1512268567.675999, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70014
Event: time 1512268567.675999, type 1 (EV_KEY), code 16 (KEY_Q), value 0
Event: time 1512268567.675999, -------------- SYN_REPORT ------------
Event: time 1512268568.531055, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7001a
Event: time 1512268568.531055, type 1 (EV_KEY), code 17 (KEY_W), value 1
Event: time 1512268568.531055, -------------- SYN_REPORT ------------

...并且我已0在我的KeyMapping字符串中将它们设置为禁用它们,但在重新启动 X 后我没有发现它们被禁用。但是,如果我将Ignore指令更改为on而不是off,我确实发现我的整个 MagicKeyboard 被禁用(而我的其他连接的键盘仍然有效)。

我的xorg.conf.d目录包含以下内容:

10-amdgpu.conf
10-evdev.conf
10-quirks.conf
10-radeon.conf
11-evdev-quirks.conf
11-evdev-trackpoint.conf
39-myinput.conf
40-libinput.conf
51-synaptics-quirks.conf
70-synaptics.conf
70-wacom.conf

我的/var/log/X.log.0包含以下内容:

[196248.970] (II) config/udev: Adding input device Magic Keyboard (/dev/input/event20)
[196248.970] (**) Magic Keyboard: Applying InputClass "Apple MagicKeyboard"
[196248.970] (**) Magic Keyboard: Applying InputClass "evdev keyboard catchall"
[196248.970] (**) Magic Keyboard: Applying InputClass "libinput keyboard catchall"
[196248.970] (**) Magic Keyboard: Applying InputClass "Apple MagicKeyboard"
[196248.970] (**) Magic Keyboard: Applying InputClass "Apple MagicKeyboard"
[196248.971] (II) Using input driver 'evdev' for 'Magic Keyboard'
[196248.971] (**) Magic Keyboard: always reports core events
[196248.971] (**) evdev: Magic Keyboard: Device: "/dev/input/event20"
[196248.971] (**) evdev: Magic Keyboard: ButtonMapping '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0'
[196248.971] (--) evdev: Magic Keyboard: Vendor 0x4c Product 0x267
[196248.971] (--) evdev: Magic Keyboard: Found 3 mouse buttons
[196248.971] (--) evdev: Magic Keyboard: Found absolute axes
[196248.971] (II) evdev: Magic Keyboard: Forcing absolute x/y axes to exist.
[196248.971] (--) evdev: Magic Keyboard: Found keys
[196248.971] (II) evdev: Magic Keyboard: Forcing relative x/y axes to exist.
[196248.971] (II) evdev: Magic Keyboard: Configuring as mouse
[196248.971] (II) evdev: Magic Keyboard: Configuring as keyboard
[196248.971] (**) evdev: Magic Keyboard: YAxisMapping: buttons 4 and 5
[196248.971] (**) evdev: Magic Keyboard: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[196248.971] (II) XINPUT: Adding extended input device "Magic Keyboard" (type: KEYBOARD, id 12)
[196248.972] (II) evdev: Magic Keyboard: initialized for absolute axes.
[196248.972] (**) Magic Keyboard: (accel) keeping acceleration scheme 1
[196248.972] (**) Magic Keyboard: (accel) acceleration profile 0
[196248.972] (**) Magic Keyboard: (accel) acceleration factor: 2.000
[196248.972] (**) Magic Keyboard: (accel) acceleration threshold: 4

我正在运行 Ubuntu 17.04。

keyboard
  • 1 1 个回答
  • 208 Views

1 个回答

  • Voted
  1. Best Answer
    anonymous b
    2018-01-06T02:36:50+08:002018-01-06T02:36:50+08:00

    ButtonMapping 是一个指针函数(用于鼠标),但您设置了 MatchIsKeyboard,这意味着您正在尝试将其应用于键盘。键盘没有按钮。您可以通过以下方式检查:

    xinput list
    

    接着

    xinput get-button-map <id-of-your-device>
    

    无论如何,您可能不想为此使用 evdev 函数,您想更改听起来像的键盘映射。

    • 2

相关问题

  • 有哪些有用的键盘快捷键?[关闭]

  • 如何在 Compiz->Commands 中获得超过 12 个命令?[关闭]

  • 输入语言切换键只接受 shift-alt 而不是 alt-shift [关闭]

  • 如何在键盘上映射未映射的键?[关闭]

  • 如何重置我的键盘布局?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve