修复 LG Gram 14 2-in-1 上音量增大/减小和静音键损坏的问题

修复 LG Gram 14 2-in-1 上音量增大/减小和静音键损坏的问题

我在 LG Gram 14 2-in-1(2020 年末,14T90N-R.AAS9U1)上运行 Kubuntu 20.04,音量增大/减小键出现问题——即使按下并释放一次,它们也表现得像是被按住了一样。这使得它们无法使用,因为按一次音量增大键会产生不可控制的多次快速连续增加音量序列,音量减小键也是如此。只需不使用这些键并使用 KDE GUI 界面调整音量,即可轻松解决这个问题,但它让我很烦恼(即使是意外按下这些键,也可能是一种令人沮丧的体验),如果可能的话,我希望修复它。

谷歌搜索了一下,结果这篇评论在 r/linuxhardware 上,另一位 LG Gram 用户也报告了同样的问题。我还发现这个问题关于影响 Medion 笔记本电脑的类似问题,已解决这里-- 在这种情况下,问题似乎与键盘发送按键事件有关,而不是按键释放事件。对我来说,evtest向上、向下和静音键的按键事件报告如下:

Event: time 1612631058.064924, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1c
Event: time 1612631058.064924, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1612631058.064924, -------------- SYN_REPORT ------------
Event: time 1612631061.892791, type 4 (EV_MSC), code 4 (MSC_SCAN), value ae
Event: time 1612631061.892791, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 2
Event: time 1612631061.892791, -------------- SYN_REPORT ------------
Event: time 1612631062.251943, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1612631062.251943, -------------- SYN_REPORT ------------
Event: time 1612631063.627541, type 4 (EV_MSC), code 4 (MSC_SCAN), value b0
Event: time 1612631063.627541, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2
Event: time 1612631063.627541, -------------- SYN_REPORT ------------
Event: time 1612631064.024607, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1612631064.024607, -------------- SYN_REPORT ------------
Event: time 1612631066.166541, type 4 (EV_MSC), code 4 (MSC_SCAN), value a0
Event: time 1612631066.166541, type 1 (EV_KEY), code 113 (KEY_MUTE), value 2
Event: time 1612631066.166541, -------------- SYN_REPORT ------------
Event: time 1612631066.486291, type 4 (EV_MSC), code 4 (MSC_SCAN), value db

由于每次按键只报告一个事件(而不是单独的按键和释放事件),我得出结论,我的问题是相同的,并且我尝试修改解决方案以适用于我的情况。在顶部的评论中/lib/udev/hwdb.d/60-keyboard.hwdb,我发现了以下内容:

# Supported hardware matches are:
[...]
#  - AT keyboard DMI data matches:
#      evdev:atkbd:dmi:bvn*:bvr*:bd*:svn<vendor>:pn<product>:pvr*
#    <vendor> and <product> are the firmware-provided strings
#    exported by the kernel DMI modalias, see /sys/class/dmi/id/modalias
[...]
# To update this file, create a new file
#   /etc/udev/hwdb.d/70-keyboard.hwdb
# and add your rules there. To load the new rules execute (as root):
#   systemd-hwdb update
#   udevadm trigger /dev/input/eventXX
# where /dev/input/eventXX is the keyboard in question. If in
# doubt, simply reload all input rules
#   udevadm trigger --verbose --sysname-match="event*"

对我来说,/sys/class/dmi/id/modalias阅读

dmi:bvnAmericanMegatrendsInc.:bvr14T90F03:bd02/27/2020:svnLGElectronics:pn14T90N-R.AAS9U1:pvr1.0:rvnLGElectronics:rn14T90N:rvr1.0:cvnLGElectronics:ct31:cvrNotused:

基于此和前面提到的答案,我创建了一个文件/lib/udev/hwdb.d/70-volume-keys-fix.hwdb,内容如下

# Fix for volume keys on LG Gram keyboard
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLGElectronics:pnP*:pvr*
 KEYBOARD_KEY_a0=!mute
 KEYBOARD_KEY_ae=!volumedown
 KEYBOARD_KEY_b0=!volumeup

并运行sudo systemd-hwdb update; udevadm trigger --verbose --sysname-match='event*'以使更改生效。这样做的唯一效果是完全禁用音量增大/减小键。

我该怎么做才能使按键正常工作?

答案1

您的供应商 ID 与您的输出不匹配/sys/class/dmi/id/modalias

正确表述应为:

evdev:atkbd:dmi:bvn*:bvr*:svnLGElectronics:pn14T90N-R.AAS9U1:*

将第二行替换为上面的一行,它应该可以工作

如果这解决了你的问题,请考虑创建一个拉取请求https://github.com/systemd/systemd这样其他用户的问题就得到了解决:)

相关内容