Bug 477710 - On Apple machines, allow keyboard shortcuts using the Fn key as a modifier
Summary: On Apple machines, allow keyboard shortcuts using the Fn key as a modifier
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: unspecified
Platform: NixOS Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-29 10:32 UTC by Marco Rebhan
Modified: 2024-02-01 04:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Rebhan 2023-11-29 10:32:22 UTC
SUMMARY
On Apple keyboards (and keyboards which are compatible with Macs, like the Keychron K8 which I have), the Fn key is passed through to the computer. In wev, this key shows up as XF86Fn (0x100811D0) when pressed. It would be great to be able to bind this key as part of a key combination in KDE applications or Plasma global shortcuts, for example, binding Full Screen to Fn+F like on macOS.


STEPS TO REPRODUCE
1. Go into a KDE application's key binding options
2. Set shortcut to some Fn key combination, for example Fn+F

OBSERVED RESULT
Nothing happens (in Plasma shortcuts) or the shortcut is set to just F (for example, in Konsole)

EXPECTED RESULT
The shortcut is set to Fn+F

SOFTWARE/OS VERSIONS
Operating System: NixOS 23.11
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.1.63 (64-bit)
Graphics Platform: Wayland
Processors: 24 × 13th Gen Intel® Core™ i7-13700F
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 6800 XT

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-11-29 21:23:29 UTC
Windows machines have Fn keys too, so it wouldn't be a Mac-specific thing.

On X11 this is probably impossible due to the changes being needed at the level of the X server which is dead, but I thikn we could probably do it on Wayland.
Comment 2 Marco Rebhan 2023-11-29 21:39:44 UTC
(In reply to Nate Graham from comment #1)
> Windows machines have Fn keys too, so it wouldn't be a Mac-specific thing.

I was under the impression that keyboards designed for Windows didn't pass through Fn, but instead did key combinations that then typed a different key/combination (for example, the media control keys) exclusively on the keyboard side. At least, that's what every keyboard I've had so far did (my K8 stops passing Fn through as well if you switch it into "Windows mode").

But yeah, having it on all keyboards that support it would be great of course, not only Mac ones.
Comment 3 fanzhuyifan 2023-11-30 03:44:01 UTC
(In reply to Nate Graham from comment #1)
> Windows machines have Fn keys too, so it wouldn't be a Mac-specific thing.
> 
> On X11 this is probably impossible due to the changes being needed at the
> level of the X server which is dead, but I thikn we could probably do it on
> Wayland.

This *is* a Mac-specific thing. On non-mac machines, the OS is not aware of fn key presses.
Instead, at the hardware level, the fn key changes the scan codes of different keys, so that
physical keys take on different meanings with the fn modifier. 

On mac this is different since the fn key press is actually sent to the OS.

[1] https://en.wikipedia.org/wiki/Fn_key
[2] https://docs.qmk.fm/#/faq_keymap?id=fn-key-on-macos