Getting the Function Keys Back on a Realme Book i5
A few years ago, I bought a Realme Book i5 for work. I bought it because it was slim, the display was nice, and it was a great lightweight machine to work on away from my desk. There was one problem I didn't expect. I use it mostly to write code, which means I constantly use the F1–F12 keys. On this laptop, the top row defaults to media keys, and I can't trigger the real F-keys without holding…
I once owned a Realme Book i5 laptop, which I acquired for its portability and excellent display. However, an inconvenience arose when I noticed the F1-F12 function keys defaulted to media keys, requiring the Fn key to be pressed to use them. Unlike some Lenovo laptops, this Realme Book i5 lacked an Fn lock toggle. To remedy this, I first experimented with remapping the keys using evremap, but the F1-F12 keys didn't emit events unless the Fn key was held.
Consequently, I resorted to using an external keyboard for coding tasks. Intrigued by the possibility of a firmware toggle, I delved into the UEFI setup where the F-keys functioned normally, suspecting the firmware might hold the key. Despite searching online for a BIOS file and attempting to decompile it, I couldn't locate the relevant flag within the disassembly.
After abandoning this path, I revisited the issue with Claude Code and its analysis of the extracted firmware files. Through this process, Claude Code revealed that the EC (Embedded Controller) exposes three fields controlling the Fn key behavior: FNSP, FNRV, and MFNM. Setting these values to FNSP=0, FNRV=1, and MFNM=0 would activate the standard F-key mode.
Utilizing a supplemental SSDT (System Firmware Table), a custom device was created in the system bus to modify these EC fields during boot. Configuring the kernel with CONFIG_ACPI_TABLE_UPGRADE enabled was essential. After compiling and packaging the AML (ACPI Machine Language) file, it was loaded before the main initramfs during boot.
With this modification, the top row of keys yielded real F1-F12 events without needing to hold the Fn key.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.