MacBook 12: Function Keys Not Working as F1-F12 in Manjaro

Hello,
I’m trying to install Manjaro on a 12-inch MacBook (MacBook Retina, 12-inch, 2017). Everything’s working fine, except for one issue: by default, the function keys are acting as media keys instead of F1-F12.

I tried to fix it by installing the package hid-apple-patched-dkms-git. I followed the instructions exactly as outlined here in wiki, installed the Linux headers, then installed hid-apple-patched-dkms-git. After installation, the hid_apple module wasn’t loading. When I ran lsmod, only mac_hid was listed, so I blacklisted mac_hid and manually forced hid_apple to load.

Since then, everything seems to be as it should and as described in the wiki. I went through the whole process described in the wiki under section 8.1, including the troubleshooting in section 8.1.1, and everything matches what’s outlined there. lsmod shows hid_apple, and cat /sys/module/hid_apple/parameters/fnmode returns 2. But the function keys are still behaving as media keys instead of F1-F12.

I tried it on both XFCE and KDE, but the result is the same on both.

Does anyone have any ideas where the issue might be or what else I could try?

System info:

System:
  Kernel: 6.10.13-3-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.10-x86_64
    root=UUID=eaf3d2e3-2323-4cd7-96b7-ca05c59c951b rw quiet
    cryptdevice=UUID=f9954bd1-f04f-4697-84c1-3504511b4029:luks-f9954bd1-f04f-4697-84c1-3504511b4029
    root=/dev/mapper/luks-f9954bd1-f04f-4697-84c1-3504511b4029 splash
    udev.log_priority=3
  Desktop: KDE Plasma v: 6.1.5 tk: Qt v: N/A info: frameworks v: 6.6.0
    wm: kwin_x11 vt: 2 dm: SDDM Distro: Manjaro base: Arch Linux
Machine:
  Type: Laptop System: Apple product: MacBook10,1 v: 1.0
    serial: <superuser required> Chassis: type: 9 v: Mac-EE2EBD4B90B839A8
    serial: <superuser required>
  Mobo: Apple model: Mac-EE2EBD4B90B839A8 v: MacBook10,1
    serial: <superuser required> uuid: <superuser required> UEFI: Apple
    v: 529.140.2.0.0 date: 06/23/2024
Battery:
  ID-1: BAT0 charge: 26.4 Wh (81.0%) condition: 32.6/42.2 Wh (77.3%)
    volts: 8.1 min: 7.6 model: SMP bq20z451 type: Li-ion serial: N/A
    status: discharging cycles: 768
Memory:
  System RAM: total: 8 GiB available: 7.66 GiB used: 1.17 GiB (15.3%)
  Message: For most reliable report, use superuser + dmidecode.
  Array-1: capacity: 16 GiB slots: 2 modules: 2 EC: None
    max-module-size: 8 GiB note: est.
  Device-1: DIMM0 type: LPDDR3 detail: synchronous size: 4 GiB
    speed: 1867 MT/s volts: curr: 1 width (bits): data: 64 total: 64
    manufacturer: 0x802C part-no: 0x4D5435324C3531324D3634443450512D3130
    serial: <filter>
  Device-2: DIMM0 type: LPDDR3 detail: synchronous size: 4 GiB
    speed: 1867 MT/s volts: curr: 1 width (bits): data: 64 total: 64
    manufacturer: 0x802C part-no: 0x4D5435324C3531324D3634443450512D3130
    serial: <filter>
PCI Slots:
  Permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i5-7Y54 bits: 64 type: MT MCP arch: Amber/Kaby Lake
    note: check level: v3 note: check built: 2017 process: Intel 14nm family: 6
    model-id: 0x8E (142) stepping: 9 microcode: 0xF6
  Topology: cpus: 1x dies: 1 clusters: 2 cores: 2 threads: 4 tpc: 2
    smt: enabled cache: L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB
    desc: 2x256 KiB L3: 4 MiB desc: 1x4 MiB
  Speed (MHz): avg: 400 min/max: 400/3200 scaling: driver: intel_pstate
    governor: powersave cores: 1: 400 2: 400 3: 400 4: 400 bogomips: 10405
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush
    clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu
    fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida
    intel_pt invpcid lahf_lm lm mca mce md_clear mmx monitor movbe mpx msr
    mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge
    pln pni popcnt pse pse36 pti pts rdrand rdseed rdtscp rep_good sdbg sep
    smap smep ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2
    tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi vpid x2apic
    xgetbv1 xsave xsavec xsaveopt xsaves xtopology xtpr
  Vulnerabilities:
  Type: gather_data_sampling mitigation: Microcode
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
    vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: IBRS
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: IBRS; IBPB: conditional; STIBP: conditional;
    RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel HD Graphics 615 vendor: Apple driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
    empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:591e class-ID: 0300
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2
    compositor: kwin_x11 driver: X: loaded: modesetting alternate: fbdev,vesa
    dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2304x1440 s-dpi: 96 s-size: 609x381mm (23.98x15.00")
    s-diag: 718mm (28.28") monitors: <missing: xrandr>
  Monitor-1: eDP-1 model: Apple Color LCD built: 2015 res: 2304x1440
    dpi: 226 gamma: 1.2 chroma: red: x: 0.655 y: 0.333 green: x: 0.298 y: 0.620
    blue: x: 0.145 y: 0.047 white: x: 0.314 y: 0.329
    size: 259x162mm (10.2x6.38") diag: 305mm (12") ratio: 16:10
    modes: 2304x1440
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
    device: 1 drv: swrast gbm: drv: iris surfaceless: drv: iris x11: drv: iris
    inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.2.4-arch1.0.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel HD Graphics 615 (KBL GT2)
    device-ID: 8086:591e memory: 3.74 GiB unified: yes
  API: Vulkan v: 1.3.295 layers: N/A device: 0 type: integrated-gpu
    name: Intel HD Graphics 615 (KBL GT2) driver: mesa intel v: 24.2.4-arch1.0.1
    device-ID: 8086:591e surfaces: xcb,xlib
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_soc_avs bus-ID: 00:1f.3 chip-ID: 8086:9d71
    class-ID: 0403
  Device-2: Broadcom 720p FaceTime HD Camera driver: N/A pcie: gen: 2
    speed: 5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 14e4:1570 class-ID: 0480
  API: ALSA v: k6.10.13-3-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.2.5 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Broadcom BCM4350 802.11ac Wireless Network Adapter vendor: Apple
    driver: brcmfmac v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    bus-ID: 02:00.0 chip-ID: 14e4:43a3 class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
  Device-1: luks-f9954bd1-f04f-4697-84c1-3504511b4029 maj-min: 254:0
    type: LUKS dm: dm-0 size: 232.79 GiB
  Components:
  p-1: nvme0n1p3 maj-min: 259:3 size: 232.8 GiB
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 465.92 GiB used: 9.94 GiB (2.1%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Apple model: SSD AP0512J
    size: 465.92 GiB block-size: physical: 4096 B logical: 4096 B
    speed: 15.8 Gb/s lanes: 2 tech: SSD serial: <filter> fw-rev: 16.14.01
    temp: 31.9 C scheme: GPT
  ID-2: /dev/nvme0n2 maj-min: 259:4 vendor: Apple model: SSD AP0512J
    C02818100FYHJD41G size: 8 KiB block-size: physical: 4096 B logical: 4096 B
    speed: 15.8 Gb/s lanes: 2 tech: SSD serial: <filter> fw-rev: 16.14.01
    temp: 30.9 C
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 232.79 GiB size: 228.08 GiB (97.98%) used: 9.93 GiB (4.4%)
    fs: ext4 dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-f9954bd1-f04f-4697-84c1-3504511b4029 label: N/A
    uuid: eaf3d2e3-2323-4cd7-96b7-ca05c59c951b
  ID-2: /boot/efi raw-size: 300 MiB size: 299.3 MiB (99.76%)
    used: 8.6 MiB (2.9%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1 label: EFI
    uuid: 5F66-17ED
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/nvme0n1p2 maj-min: 259:2 size: 232.83 GiB fs: apfs label: N/A
    uuid: dfc29eb5-241c-4e26-b4c4-f30586c60267
USB:
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-2: 2-0:1 info: super-speed hub ports: 6 rev: 3.0
    speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 33.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Repos:
  Packages: pm: pacman pkgs: 1225 libs: 353 tools: pamac pm: flatpak pkgs: 0
  Active pacman repo servers in: /etc/pacman.d/mirrorlist
    1: https://mirror.init7.net/manjaro/stable/$repo/$arch
    2: https://mirror.ufam.edu.br/manjaro/stable/$repo/$arch
    3: https://linorg.usp.br/manjaro/stable/$repo/$arch
Processes:
  CPU top: 5 of 178
  1: cpu: 0.8% command: plasmashell pid: 759 mem: 338.2 MiB (4.3%)
  2: cpu: 0.6% command: kwin_x11 pid: 716 mem: 170.6 MiB (2.1%)
  3: cpu: 0.5% command: Xorg pid: 546 mem: 70.5 MiB (0.8%)
  4: cpu: 0.3% command: zsh pid: 1127 mem: 12.6 MiB (0.1%)
  5: cpu: 0.2% command: konsole pid: 1105 mem: 109.1 MiB (1.3%)
  Memory top: 5 of 178
  1: mem: 338.2 MiB (4.3%) command: plasmashell pid: 759 cpu: 0.8%
  2: mem: 170.6 MiB (2.1%) command: kwin_x11 pid: 716 cpu: 0.6%
  3: mem: 109.1 MiB (1.3%) command: konsole pid: 1105 cpu: 0.2%
  4: mem: 100.5 MiB (1.2%) command: kded6 pid: 715 cpu: 0.0%
  5: mem: 78.4 MiB (0.9%) command: kdeconnectd pid: 964 cpu: 0.0%
Info:
  Processes: 178 Power: uptime: 25m states: freeze,mem,disk suspend: deep
    avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 3.05 GiB services: org_kde_powerdevil,
    power-profiles-daemon, upowerd Init: systemd v: 256 default: graphical
    tool: systemctl
  Compilers: gcc: 14.2.1 Shell: Zsh v: 5.9 default: Bash v: 5.2.37
    running-in: konsole inxi: 3.3.36

Do you have an “fn” button on your keyboard ? I have to press it together with F1 - F12 to avoid the media functions…

A modifier key is typically used for the function keys to be used as their multimedia counterparts.

There is often a toggle for this in BIOS which determines whether the Function keys or the Multimedia keys will be default. Specifically where that toggle is, I can’t say.

But, your user manual might be a good place to start.

I hope this helps. Cheers.

That does not work for macBook. Around 2017 Apple introducted a touchbar which changes function depending on the foreground application.

Such devices is depending on software to switch functionality.

As I recall 2017 was one of the last years where you could choose between touchbar and conventional f-keys.

Check this: Apple Keyboard - ArchWiki

Yes, that’s exactly right, this MacBook doesn’t have a traditional BIOS where you could switch the function key behavior. I think the only way to achieve this is by following the method described in the Arch wiki, which for some reason isn’t working on my MacBook.

I followed that exactly, as I mentioned in my first post, but unfortunately it’s not working on my MacBook.