You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated recently and found that the when I enable the fn key my keyboard no longer lets me type normally and pressing the function keys do not work eg F5 to reload browser tab. It will also lock up the kde desktop (unable to interact with the task bar).
I am running 6.15.3-1.surface.fc42.x86_6 on Fedora 42 KDE Spin
Heres a list of outputs from showkey -a. The keys seem to be mapped right so my guess is its something to do with the FN key?
Also experiencing this on a fresh install. The behavior is exactly like that described in #1719 but this is on a surface laptop 4 with built-in keyboard using Plasma on Arch..
I've identified the root cause and created a working fix for this issue.
Root Cause
The Surface Aggregator Module firmware incorrectly reports the FN key as BTN_0 (button 256) through runtime HID events. This button can get stuck in pressed state, flooding the input system with repeated press events (~every 34ms), which breaks input focus tracking in KWin Wayland.
Solution
Created a new HID driver (hid-surface.c) that filters BTN_0 events using the event callback. This prevents BTN_0 from reaching the input subsystem while allowing all other keyboard/touchpad functionality to work normally.
If you're experiencing this issue, please test the patch and report back! I'm especially interested in hearing from:
Surface Laptop 3/5 users
Surface Pro 9 users
Users on other compositors (GNOME Wayland, Sway, Hyprland, etc.)
If testing goes well, I'm happy to submit this as a formal PR. The fix is minimal, well-tested on my hardware, and ready for merging.
Technical Details
Key insight: BTN_0 is NOT in the HID descriptor - it's generated dynamically at runtime from HID reports. This is why the fix required using the event callback rather than input_mapping.
Why it affects KWin Wayland specifically: X11 and GNOME Wayland handle stuck button events more gracefully. KWin Wayland's focus tracking is more sensitive to input flooding, though this could be improved on the KWin side as well (separate issue).
Reacted by leinaht, ben, Richard O'Donoghue and TaromaruYuki
Activity
leinaht commentedon Sep 9, 2025
Also experiencing this on a fresh install. The behavior is exactly like that described in #1719 but this is on a surface laptop 4 with built-in keyboard using Plasma on Arch..
ciarancoffey commentedon Oct 9, 2025
I've had this for months, and I could never figure out what going on with keyboard and mouse focus.
I'm using a SL4A.
I was suspending the laptop by closing the screen and this would resolve it.
sudo modprobe -r surface_hid && sudo modprobe surface_hidIs working around it also. I'll keep digging.
ciarancoffey commentedon Oct 9, 2025
@RichardODonoghue and @leinaht are you both using KDE on wayland? This seems to be the only combination that triggers this bug for me.
Add patch to filter BTN_0 (FN key) events on Surface devices
ciarancoffey commentedon Oct 10, 2025
I've identified the root cause and created a working fix for this issue.
Root Cause
The Surface Aggregator Module firmware incorrectly reports the FN key as BTN_0 (button 256) through runtime HID events. This button can get stuck in pressed state, flooding the input system with repeated press events (~every 34ms), which breaks input focus tracking in KWin Wayland.
Solution
Created a new HID driver (
hid-surface.c) that filters BTN_0 events using theeventcallback. This prevents BTN_0 from reaching the input subsystem while allowing all other keyboard/touchpad functionality to work normally.Testing Results
Hardware: Surface Laptop 4 AMD (Ryzen 5)
OS: Arch Linux, Kernel 6.16.9-arch1-1-surface
Desktop: KDE Plasma 6.4.5 Wayland
After applying the fix:
Patch
The fix adds 3 files totaling 99 lines:
drivers/hid/hid-surface.c(new, 90 lines)drivers/hid/Kconfig(modified, +8 lines)drivers/hid/Makefile(modified, +1 line)Patch file: https://github.com/ciarancoffey/linux-surface/blob/fn-key-btn0-fix/patches/6.16/0016-hid-surface-fn-key.patch
Compatibility
Request for Testing
If you're experiencing this issue, please test the patch and report back! I'm especially interested in hearing from:
If testing goes well, I'm happy to submit this as a formal PR. The fix is minimal, well-tested on my hardware, and ready for merging.
Technical Details
Key insight: BTN_0 is NOT in the HID descriptor - it's generated dynamically at runtime from HID reports. This is why the fix required using the
eventcallback rather thaninput_mapping.Why it affects KWin Wayland specifically: X11 and GNOME Wayland handle stuck button events more gracefully. KWin Wayland's focus tracking is more sensitive to input flooding, though this could be improved on the KWin side as well (separate issue).
Add patch to filter BTN_0 (FN key) events on Surface devices
Tom-Finke commentedon Dec 10, 2025
For me this also happens under sway. See https://bbs.archlinux.org/viewtopic.php?pid=2277156
HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
49 remaining items
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)
SURFACE: HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)
HID: Add hid-surface driver to filter BTN_0 (FN key)