Function Key becomes permanently pressed after a couple of minutes after boot (temporary fix: reboot)

System

========================== Kernel ===============================
Installed kernel: 6.6.7-200.fc39.x86_64
========================== Operating System =====================
OS: Fedora Linux 39 (Workstation Edition) x86_64 
Host: Laptop (12th Gen Intel Core) A4 
Kernel: 6.6.7-200.fc39.x86_64 
Uptime: 2 hours, 27 mins 
Packages: 7193 (rpm), 202 (brew), 45 (flatpak) 
Shell: bash 5.2.21 
Resolution: 2256x1504 
DE: GNOME 45.2 
WM: Mutter 
WM Theme: Adwaita 
Theme: NumixSolarizedDarkOrange [GTK2/3] 
Icons: Solarized-FLAT-Orange [GTK2/3] 
Terminal: vscode 
CPU: 12th Gen Intel i5-1240P (16) @ 4.400GHz 
GPU: Intel Alder Lake-P GT2 [Iris Xe Graphics] 
Memory: 8191MiB / 31802MiB 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Display Server: wayland
Systemd Version: systemd 254 (254.7-1.fc39)
~~~~~~~~~~~~~~~~~~~~~~~~~~~Machine~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Machine:
  Type: Laptop System: Framework product: Laptop (12th Gen Intel Core) v: A4
    serial: FRANDACPA42382002Q
  Mobo: Framework model: FRANMACP04 v: A4 serial: FRANMACPA423620037
    UEFI: INSYDE v: 03.06 date: 11/10/2022
~~~~~~~~~~~~~~~~~~~~~~~~~~~CPU~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CPU:
  Info: 12-core (4-mt/8-st) model: 12th Gen Intel Core i5-1240P bits: 64
    type: MST AMCP cache: L2: 9 MiB
  Speed (MHz): avg: 697 min/max: 400/4400:3300 cores: 1: 808 2: 848 3: 860
    4: 900 5: 698 6: 1042 7: 942 8: 400 9: 400 10: 400 11: 896 12: 400 13: 747
    14: 400 15: 1020 16: 400
~~~~~~~~~~~~~~~~~~~~~~~~~~~RAM~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Memory:
  System RAM: total: 32 GiB available: 31.06 GiB used: 8.48 GiB (27.3%)
    igpu: 60 MiB
  Array-1: capacity: 64 GiB slots: 2 modules: 2 EC: None
  Device-1: Controller0-ChannelA-DIMM0 type: DDR4 size: 16 GiB
    speed: 3200 MT/s
  Device-2: Controller1-ChannelA-DIMM0 type: DDR4 size: 16 GiB
    speed: 3200 MT/s
~~~~~~~~~~~~~~~~~~~~~~~~~~~Storage~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drives:
  Local Storage: total: 1.82 TiB used: 677.67 GiB (36.4%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 990 PRO 2TB size: 1.82 TiB
  Message: No optical or floppy data found.
~~~~~~~~~~~~~~~~~~~~~~~~~~~LVM~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Logical:
  Device-1: VG: vgubuntu type: LVM2 size: 1.82 TiB free: 0 KiB
  LV-1: Backup type: linear size: 100 GiB Components: p-1: nvme0n1p5
  LV-2: Data type: linear size: 100 GiB Components: p-1: nvme0n1p5
  LV-3: Documents type: linear size: 250 GiB Components: p-1: nvme0n1p5
  LV-4: FedoraHome type: linear size: 18 GiB Components: p-1: nvme0n1p5
  LV-5: FedoraRoot type: linear size: 100 GiB Components: p-1: nvme0n1p5
  LV-6: FedoraSwap type: linear size: 32 GiB Components: p-1: nvme0n1p5
  LV-7: Harddisk type: linear size: 660.64 GiB Components: p-1: nvme0n1p5
  LV-8: Media type: linear size: 500 GiB Components: p-1: nvme0n1p5
  LV-9: UbuntuHome type: linear size: 18 GiB Components: p-1: nvme0n1p5
  LV-10: UbuntuRoot type: linear size: 50 GiB Components: p-1: nvme0n1p5
  LV-11: UbuntuSwap type: linear size: 32 GiB Components: p-1: nvme0n1p5
~~~~~~~~~~~~~~~~~~~~~~~~~~~Graphics~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics:
  Device-1: Intel Alder Lake-P GT2 [Iris Xe Graphics] driver: i915 v: kernel
  Device-2: Realtek [] driver: uvcvideo type: USB
  Display: server: X.Org v: 23.2.3 with: Xwayland v: 23.2.3 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915
    resolution: 2256x1504~60Hz
  API: OpenGL v: 4.6 vendor: intel mesa v: 23.3.1 renderer: Mesa Intel
    Graphics (ADL GT2)
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
~~~~~~~~~~~~~~~~~~~~~~~~~~~Audio~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Audio:
  Device-1: Intel Alder Lake PCH-P High Definition Audio driver: snd_hda_intel
  API: ALSA v: k6.6.7-200.fc39.x86_64 status: kernel-api
~~~~~~~~~~~~~~~~~~~~~~~~~~~Battery~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Battery:
  ID-1: BAT1 charge: 31.0 Wh (60.2%) condition: 51.5/55.0 Wh (93.5%)
    volts: 15.8 min: 15.4
~~~~~~~~~~~~~~~~~~~~~~~~~~~Bluetooth~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bluetooth:
  Device-1: Intel AX210 Bluetooth driver: btusb type: USB
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: 8C:F8:C5:ED:74:4C bt-v: 5.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~Network~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Network:
  Device-1: Intel Wi-Fi 6 AX210/AX211/AX411 160MHz driver: iwlwifi
  IF: wlp166s0 state: up mac: 1a:35:8a:7f:96:29

  • The top bar of my inbuilt laptop keyboard has media keys and some other functions. The media keys work as F1, F2, F3…,F12, when I press them along with the fn key.

  • I was on Fedora Linux (6.5.10-300.fc39.x86_64) 39 (Workstation Edition) from past few months. From last week the function key on my laptop fn becomes permanently pressed randomly after a couple of minutes of reboot . That means I am unable to play media keys as when I press those without pressing fn F1,…,F12 keys get activated. This fixes temporarily for few minutes after reboot. But again its the same issue.

  • Today I updated to kernel: 6.6.7-200.fc39.x86_64 and every software on my Fedora 39, but I am still facing the issue.

What should I do?

Just to verify that what you think is happening is really the case, can you run xev in a terminal and then press F1 first without holding the fn key and then again with fn pressed? I get the following results on my Fedora Linux system (currently running 6.6.6-100.fc38.x86_64).

F1 without fn:

KeyPress event, serial 38, synthetic NO, window 0x1400001,
    root 0x3ca, subw 0x0, time 11522892, (602,834), root:(602,972),
    state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x1400001,
    root 0x3ca, subw 0x0, time 11522952, (602,834), root:(602,972),
    state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

F1 with fn:

KeyPress event, serial 38, synthetic NO, window 0x1400001,
    root 0x3ca, subw 0x0, time 11564913, (535,810), root:(535,948),
    state 0x10, keycode 180 (keysym 0x1008ff18, XF86HomePage), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x1400001,
    root 0x3ca, subw 0x0, time 11565013, (535,810), root:(535,948),
    state 0x10, keycode 180 (keysym 0x1008ff18, XF86HomePage), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
  • Pressing: Volume Mute Key(as can be seen in the first post with image of the keyboard) i.e. F1 without fn
KeyPress event, serial 38, synthetic NO, window 0x1c00001,
    root 0x4a4, subw 0x0, time 10824947, (508,1177), root:(558,1304),
    state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x1c00001,
    root 0x4a4, subw 0x0, time 10825079, (508,1177), root:(558,1304),
    state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
  • Pressing fn + F1
KeyPress event, serial 38, synthetic NO, window 0x1c00001,
    root 0x4a4, subw 0x0, time 10827233, (508,1177), root:(558,1304),
    state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x1c00001,
    root 0x4a4, subw 0x0, time 10827375, (508,1177), root:(558,1304),
    state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

It looks like your fn key has been disabled. In the screenshot you posted initially, I see that your keyboard has a “fn lock” function that can be toggled by pressing fn+esc. Is it possible that you’ve pressed that key combination to disable your fn key? There may be other ways of enabling/disabling that key (e.g., BIOS or GNOME settings).

No, I have not clicked fn lock key. I have tested this atleast 5 times that after few minutes of reboot this behavior happens. Even with clicking fn lock nothing happens. To toggle (disable or enable) it we are suppose to press fn + fn lock but the behavior does not toggles.

Sorry, I’m not sure what the problem could be then. Is it possible that you’ve switched the keyboard layout somehow? Sometimes “hotkey” combinations like Alt+Shift can be configured to switch keyboard layouts. For reference, below is what I see on my system when I run setxkbmap -print -verbose 10.

Setting verbose level to 10
WARNING: Running setxkbmap against an Xwayland server
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

FWIW, here is a introductory blog post about Linux’s libinput driver:

If I’m reading that blog post correctly, it looks like udev events might trigger device reconfiguration/re-detection. Is it possible that you have some bluetooth device that is pairing with your system and triggering a reconfiguration? Or maybe you are connecting something like a Yubikey? I’m just guessing at this point. Sorry, I don’t know. Hopefully someone else will chime in with ideas about what might be going wrong.

I have a UK English Layout of keyboard. And key specific to this layout work properly as shown on the keyboard. For example the unique location of # key on UK layout works fine.

$ sudo setxkbmap -print -verbose 10
Place your right ring finger on the fingerprint reader
Setting verbose level to 10
WARNING: Running setxkbmap against an Xwayland server
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+inet(evdev)"     };
        xkb_geometry  { include "pc(pc105)"     };
};

I have not connected my laptop to any other device. Bluetooth is switched off. I am using wired headphones.

One last thing you might want to try is updating your system’s firmware.

I checked, I am using the latest firmware.

Because you’re using a Framework laptop, I think the issue is similar to the one discussed here: Framework Community Forum.
Unfortunately, the potential fix is currently under testing.

1 Like

It looks like people are reporting on that forum that blacklisting cros_ec_lpcs works around the problem. The following command should accomplish that on Fedora Linux systems.

sudo grubby --args "modprobe.blacklist=cros_ec_lpcs rd.driver.blacklist=cros_ec_lpcs" --update-kernel ALL
1 Like

If it means anything, I’m seeing the exact same symptoms (as far as I can tell) on a Lenova laptop using up-to-date F39 KDE. I’ll be checking on my Dell laptop later tonight. Honestly, it looks like an unexpected software change.