Advanced Function Key Remapping Tool for Apple Silicon Macs
Remap your MacBook's function keys to control keyboard backlight, media playback, and more — using native macOS hidutil. No third-party apps required!
- 🔆 Keyboard Backlight Control — Missing on Apple Silicon Macs? Not anymore!
- 🎵 Media Controls — Quick access to Play/Pause, Next/Previous track
- 🛠️ Custom Mapping Builder — Create your own key combinations
- 💾 Persistent — Survives restarts via LaunchAgent
- 🖥️ Interactive Menu — Beautiful TUI for easy configuration
- ⌨️ CLI Support — Script-friendly commands for automation
- 🍎 Native — Uses macOS
hidutil, no kernel extensions
| Requirement | Supported |
|---|---|
| Chip | Apple Silicon (M1, M2, M3, M4 series) |
| macOS | 14 Sonoma, 15 Sequoia, and later |
| MacBook | Air, Pro (all Apple Silicon models) |
curl -fsSL https://raw.githubusercontent.com/nurkamol/mac-fn-key-remapper/main/mac-fn-key-remapper.sh -o mac-fn-key-remapper.sh && chmod +x mac-fn-key-remapper.sh && ./mac-fn-key-remapper.sh# Clone the repository
git clone https://github.com/nurkamol/mac-fn-key-remapper.git
cd mac-fn-key-remapper
# Make executable
chmod +x mac-fn-key-remapper.sh
# Run interactive menu
./mac-fn-key-remapper.shSimply run the script without arguments:
./mac-fn-key-remapper.shYou'll see a beautiful menu:
╔═══════════════════════════════════════════════════════════════╗
║ ⌨️ MAC FN KEY REMAPPER 💡 ║
║ Advanced Function Key Remapping Tool ║
║ Apple Silicon Mac Edition ║
╚═══════════════════════════════════════════════════════════════╝
[1] Preset: Keyboard Backlight (F4↓ F5↑)
[2] Preset: Media Controls (F4⏮ F5⏯ F6⏭)
[3] Preset: Backlight + Media (F4↓ F5↑ F6⏯)
[4] Custom Mapping Builder
[5] Disable All Mappings
...
# Enable keyboard backlight control
./mac-fn-key-remapper.sh backlight
# Enable media controls
./mac-fn-key-remapper.sh media
# Enable both backlight and play/pause
./mac-fn-key-remapper.sh combo
# Disable all mappings
./mac-fn-key-remapper.sh unload
# Check current status
./mac-fn-key-remapper.sh status
# Show version
./mac-fn-key-remapper.sh version| Key | New Function | Original |
|---|---|---|
| F4 | Backlight Down ↓ | Spotlight |
| F5 | Backlight Up ↑ | Dictation |
| Key | New Function | Original |
|---|---|---|
| F4 | Previous Track ⏮ | Spotlight |
| F5 | Play/Pause ⏯ | Dictation |
| F6 | Next Track ⏭ | Do Not Disturb |
| Key | New Function | Original |
|---|---|---|
| F4 | Backlight Down ↓ | Spotlight |
| F5 | Backlight Up ↑ | Dictation |
| F6 | Play/Pause ⏯ | Do Not Disturb |
| Code | Key | Default Function |
|---|---|---|
0xFF0100000010 |
F3 | Mission Control |
0x0C00000221 |
F4 | Spotlight |
0x10000009B |
F5 | Dictation |
0xC000000CF |
F6 | Do Not Disturb |
0x0C000002A2 |
F4 | Launchpad (alt) |
| Code | Action |
|---|---|
0xFF00000008 |
Keyboard Backlight Up |
0xFF00000009 |
Keyboard Backlight Down |
0xFF00000004 |
Display Brightness Up |
0xFF00000005 |
Display Brightness Down |
0xC000000CD |
Play/Pause |
0xC000000B5 |
Next Track |
0xC000000B6 |
Previous Track |
0xC000000E2 |
Mute |
0xC000000E9 |
Volume Up |
0xC000000EA |
Volume Down |
A: Use Cmd + Space (default macOS shortcut)
A: Go to System Settings → Keyboard → Dictation or set a custom shortcut
A: Yes! The script creates a LaunchAgent that loads automatically at login
./mac-fn-key-remapper.sh unload
rm ~/Library/LaunchAgents/com.local.KeyRemapping.plistA: Some mappings may work, but this tool is designed and tested for Apple Silicon
Contributions are welcome! Feel free to:
- 🐛 Report bugs
- 💡 Suggest features
- 🔀 Submit pull requests
MIT License © 2026 Nurkamol Vakhidov
Nurkamol Vakhidov
- 🌐 Website: nurkamol.com
- 📧 Email: nurkamol@gmail.com
- 🐙 GitHub: @nurkamol
Made with ❤️ for the Mac community