Skip to content

Instantly share code, notes, and snippets.

@HappyCodingRobot
Created January 8, 2019 14:22
Show Gist options
  • Save HappyCodingRobot/df400e16d0615e98e2c1eee738925d0b to your computer and use it in GitHub Desktop.
Save HappyCodingRobot/df400e16d0615e98e2c1eee738925d0b to your computer and use it in GitHub Desktop.
Activate mic mute function key, ubuntu 18.04, HP Elitebook 820
# see also: /lib/udev/hwdb.d/60-keyboard.hwdb
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*EliteBook*:pvr*
KEYBOARD_KEY_81=f20 # Fn+F8 on Elitebook, map to F20
# KEYBOARD_KEY_81=fn_esc # org entry
Problem: mic mute button (Fn+F8) does not work
Cause: mapped to wrong code (Fn+Esc)
Solve:
- create local .hwdb file with correct mapping in /etc/udev/hwdb.d/
- generate new /lib/udev/hwdb.bin file and reload it:
sudo udevadm -d hwdb --update; sudo udevadm -d control --reload; sudo udevadm trigger
# see:
# https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1535219
# https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1535219
# https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/
#
cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input3
U: Uniq=
H: Handlers=sysrq kbd event3 leds
B: PROP=0
B: EV=120013
B: KEY=20000 20000000020 0 0 1500f02100000 3803078f900d401 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7
sudo evtest /proc/input/event3
Event code 465 (KEY_FN_ESC)
..
Event: time 1546950805.062235, -------------- SYN_REPORT ------------
Event: time 1546950807.953693, type 4 (EV_MSC), code 4 (MSC_SCAN), value 81
Event: time 1546950807.953693, type 1 (EV_KEY), code 465 (KEY_FN_ESC), value 1
Event: time 1546950807.953693, -------------- SYN_REPORT ------------
Event: time 1546950808.116791, type 4 (EV_MSC), code 4 (MSC_SCAN), value 81
Event: time 1546950808.116791, type 1 (EV_KEY), code 465 (KEY_FN_ESC), value 0
sudo find /sys/ -name event3
: /sys/class/input/event3
: /sys/devices/platform/i8042/serio0/input/input3/event3
...
@redfox7691
Copy link

On my HP 840 G7/Ubuntu 20.04 this workaround does not work. You need change svnHewlett-Packard into svnHP according to /sys/class/dmi/id/modalias

@HappyCodingRobot
Copy link
Author

The above still works for me on HP 820 after updating to Kubuntu 20.04
But good to know that it is different on the HP 840. Thank you for your info..

@BUBUsnet
Copy link

On my HP 840 G7/Ubuntu 20.04 this workaround does not work. You need change svnHewlett-Packard into svnHP according to /sys/class/dmi/id/modalias

Can confirm this workaround for HP 845 G7/Linux Mint 20. Thx

@minzak
Copy link

minzak commented Feb 20, 2021

Very strange, on EliteBook 850 G7:
Mute - has the same cote with brightnessdown and brightnessup.
And after that, I Have 3 buttons with the same functionality. ((
How to Bind FnF3 + FnF4 + FnF8 at the same time?

UPD. Need just Power reset to do.

@ciceron166
Copy link

I tried using your scrip but mic mute still doesn't work, i then proceded with cat /proc/bus/input/devices and only difference i found between yours and mine is that S: Sysfs=/devices/platform/i8042/serio0/input/input3
U: Uniq=
H: Handlers=sysrq kbd event3 leds are different from mine. Mine says input4 and event4.
Could this be the problem for it not working,btw im using hp elitebook g6 830.
Any help would be highly appreciated.

@Massimo-B
Copy link

Massimo-B commented Apr 19, 2022

G7

Did you get this solved on the G7? I can't get the mic-mute button working on the HP ZBook G8.
In the syslog I see:

[kernel] [24809.757040] atkbd serio0: Unknown key pressed (raw set 2, code 0xf6 on isa0060/serio0).
[kernel] [24809.757043] atkbd serio0: Use 'setkeycodes e076 <keycode>' to make it known.
[kernel] [24809.822499] atkbd serio0: Unknown key released (raw set 2, code 0xf6 on isa0060/serio0).
[kernel] [24809.822502] atkbd serio0: Use 'setkeycodes e076 <keycode>' to make it known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment