Bug 481142 - Handle the XF86_RFKILL key
Summary: Handle the XF86_RFKILL key
Status: CONFIRMED
Alias: None
Product: plasma-nm
Classification: Plasma
Component: applet (show other bugs)
Version: 5.27.8
Platform: NixOS Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on: 475574
Blocks:
  Show dependency treegraph
 
Reported: 2024-02-09 20:25 UTC by ibbem
Modified: 2024-02-14 22:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ibbem 2024-02-09 20:25:00 UTC
SUMMARY

The rfkill driver of the Linux kernel provides the rfkill-input module, which handles the XF86XK_RFKill key. However, according to https://www.kernel.org/doc/html/latest/driver-api/rfkill.html, the Kconfig option RFKILL_INPUT can be used to disable the "deprecated rfkill-input module (an input layer handler, being replaced by userspace policy code)". Currently, KDE doesn't implement such a userspace policy as far as I know.

I just wanted to notify you because NixOS stumbled upon this issue accidentally. See https://github.com/NixOS/nixpkgs/issues/261880. I am not quite sure if plasma-nm is the component responsible for this. However, I found the related bug https://bugs.kde.org/show_bug.cgi?id=349744 which is categorized the same way. I also did some quick experiments on Gnome. I think Gnome always handles XF86XK_RFKill and disables the rfkill-input module using the ioctl.


STEPS TO REPRODUCE
Ensure to use a computer which has an "airplane" key and which is using a rfkill driver (e.g., a typical laptop).
1. Install a kernel with `RFKILL_INPUT` disabled. (The same effect should be achievable using the ioctl mentioned in https://www.kernel.org/doc/html/latest/driver-api/rfkill.html but I didn't test that.)
2. Boot into KDE Plasma.
3. Press the "airplane" key.

OBSERVED RESULT
Nothing happens. It can be verified using xev that a XF86XK_RFKill key press is sent.

EXPECTED RESULT
Airplane mode is toggled.

SOFTWARE/OS VERSIONS
nixpkgs commit: ca012a02bf8327be9e488546faecae5e05d7d749
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.27.8
Qt Version: 5.15.10
Comment 1 fanzhuyifan 2024-02-09 20:59:16 UTC
Currently for shortcuts we rely on Qt keys, which doesn't have the XF86_RFKILL key. So on that front there is a similar problem as in 475574.

On the other hand I think exposing a shortcut for toggling airplane mode is probably reasonable and quite doable.