Score:0

Odd behavior of function Fn keys on MSI Creator on Ubuntu 23.04

pf flag

I am currently experiencing problems with the function keys on my MSI Creator 17 B11UG. It has gotten worse and worse with every Ubuntu update (currently 23.04) and I have a particular interest in making the webcam work again, as it is apparently just got stuck in the "hardware disabled state". Some function keys work (mute, volume up/down, keyboard light), some stopped working after the upgrade, some log errors into dmesg, and some work but don't register on showkey -k. The detailed table with description how function keys behave currently:

Fn keys problems description table

UPD: I initially created a markdown table, which looked very nice on the preview, but got scrambled for some reason when I posted, so I created an image instead.

showkey -k detects absolutely the same codes if function keys are pressed alone or together with the Fn key. I also checked the BIOS settings and there isn't any setting which changes the way Fn keys work.

sudo udevadm info /dev/input/by-path/platform-i8042-serio-0-event-kbd gives me this output:

P: /devices/platform/i8042/serio0/input/input3/event3
M: event3
R: 3
U: input
D: c 13:67
N: input/event3
L: 0
S: input/by-path/platform-i8042-serio-0-event-kbd
E: DEVPATH=/devices/platform/i8042/serio0/input/input3/event3
E: DEVNAME=/dev/input/event3
E: MAJOR=13
E: MINOR=67
E: SUBSYSTEM=input
E: USEC_INITIALIZED=5374008
E: KEYBOARD_KEY_a0=mute
E: KEYBOARD_KEY_ae=volumedown
E: KEYBOARD_KEY_b0=volumeup
E: KEYBOARD_KEY_b2=www
E: KEYBOARD_KEY_c2=ejectcd
E: KEYBOARD_KEY_df=sleep
E: KEYBOARD_KEY_e2=bluetooth
E: KEYBOARD_KEY_e4=f21
E: KEYBOARD_KEY_ec=email
E: KEYBOARD_KEY_ee=camera
E: KEYBOARD_KEY_f6=wlan
E: KEYBOARD_KEY_f7=brightnessdown
E: KEYBOARD_KEY_f8=brightnessup
E: KEYBOARD_KEY_f9=search
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_BUS=i8042
E: ID_SERIAL=noserial
E: ID_PATH=platform-i8042-serio-0
E: ID_PATH_TAG=platform-i8042-serio-0
E: XKBMODEL=pc105
E: XKBLAYOUT=us,ru
E: XKBVARIANT=,
E: XKBOPTIONS=grp:alt_shift_toggle,lv3:ralt_alt,compose:caps,terminate:ctrl_alt_bksp,grp_led:scroll
E: BACKSPACE=guess
E: LIBINPUT_DEVICE_GROUP=11/1/1:isa0060/serio0
E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-0-event-kbd
E: TAGS=:power-switch:
E: CURRENT_TAGS=:power-switch:

All the diagnostic means (see the table above) seemingly give me contradictory results, e.g. F8 works and changes the keyboard lights, but showkey registers nothing and dmesg logs an error, some keys generate Unknown event received, some Unknown key pressed, some both.

udevadm info apparently points to the fact that the keyboard was identified incorrectly (as the output contains E: KEYBOARD_KEY_f9=search for instance and I don't have that key), so I tried fiddling with /lib/udev/hwdb.d:

I edited /lib/udev/hwdb.d/90-keyboard-ubuntu.hwdb:

# Dell G16 microphone mute
evdev:name:Dell WMI hotkeys:dmi:bvn*:bvr*:bd*:svnDell*:pnDellG16*:*
 KEYBOARD_KEY_100150=f20

evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*pnCreator17B11UG*:*
 KEYBOARD_KEY_ee=camera                                 # Fn+F6 camera disable

Namely, I added the last two lines, everything else was there before. Then I applied the changes: systemd-hwdb update and udevadm trigger --verbose --sysname-match="event*". After that nothing seemingly changed in the behavior of the F6 key. I also tried some other random stuff, like changing camera to !camera or other hex-keys instead of KEYBOARD_KEY_ee, but it seemingly changed nothing.

Since neither showkey -k nor dmesg gave me any indication as to what was the actual hex value of the F6 key, I tried sudo evtest:

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Lid Switch
/dev/input/event1:  Sleep Button
/dev/input/event10: HDA NVidia HDMI/DP,pcm=7
/dev/input/event11: HDA NVidia HDMI/DP,pcm=8
/dev/input/event12: HDA NVidia HDMI/DP,pcm=9
/dev/input/event13: Video Bus
/dev/input/event14: Video Bus
/dev/input/event15: sof-hda-dsp Mic
/dev/input/event16: sof-hda-dsp Headphone
/dev/input/event17: sof-hda-dsp HDMI/DP,pcm=3
/dev/input/event18: sof-hda-dsp HDMI/DP,pcm=4
/dev/input/event19: sof-hda-dsp HDMI/DP,pcm=5
/dev/input/event2:  Power Button
/dev/input/event3:  AT Translated Set 2 keyboard
/dev/input/event4:  SynPS/2 Synaptics TouchPad
/dev/input/event5:    FX-2
/dev/input/event6:    FX-2 Keyboard
/dev/input/event7:  MSI WMI hotkeys
/dev/input/event8:  gpio-keys
/dev/input/event9:  HDA NVidia HDMI/DP,pcm=3
Select the device event number [0-19]: 7
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "MSI WMI hotkeys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 148 (KEY_PROG1)
    Event code 149 (KEY_PROG2)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 240 (KEY_UNKNOWN)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
^C

It recognized /dev/input/event7: MSI WMI hotkeys, but upon actual testing when I pressed in sequence all function keys (with or without the Fn key) it yielded no output whatsoever. It works with the regular keyboard though.

I would greatly appreciate any advice on how to investigate further or even how to fix the issue. As a workaround I also will be interested in your suggestions as to how can I enable my webcam alternatevely (i.e. imitate pressing Fn + F6 in some other way or maybe something along those lines).

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.