How to Remap Brightness Hotkeys on Laptops

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
How to Remap Brightness Hotkeys on Laptops

An EliteMacx86 Exclusive Guide - This guide covers mapping of Brightness Hotkeys on Laptops

Overview


After enabling the backlight which results in adding slider in SysPrefs->Displays, the brightness hotkeys will not work. This guide will enable the brightness hotkeys on your laptop. By using the hotkyes, you can control the amount of brightness.

Before starting with this guide, make sure you've implemented the Backlight Control on your Laptop

Once you've fixed your backlight control, you can remap your brightness hotkeys.
All the keys on the keyboard have a unique code. The brightness keys can be controlled as Fn+Fx. Some laptops uses Arrow Keys too.

Finding Keyboard Driver


First you need to find what Keyboard driver is there. To find this, you can use IOReg.
  • Open IOReg
  • Search for Keyboard
In the left pane, you'll find something similar to this
Screen Shot 2018-08-30 at 8.49.45 PM.png


In this case, ApplePS2Keyboard attaches to ApplePS2KeyboardDevice, which attaches to ps2controller, all of which attach to KBC0, this is the device name we're looking for.

Note:
  • All laptops does not use KBC0, some may use PS2K.
You'll need to know what exact codes or the commands is called when the key is pressed. Usually, media keys generate EC queries. A quick way to know is to use ACPIDebug.kext to instrument all EC query methods, then press the keys while monitoring system.log. When you press the keys, the name of the method will be output, which will allow you to patch that method.

Notes :
Determining the EC query methods


ACPIDebug.kext: https://github.com/RehabMan/OS-X-ACPI-Debug
Download and install the ACPIDebug.kext to S/L/E
Open MaciASL and add the ACPIDebug in Sources
Open your DSDT and apply "Add DSDT Debug Methods"
Also apply "Instrument EC Queries"
Click on Close
Save the DSDT file to any other location.
Copy the patched DSDT to your EFI/ACPI/Patched
Restart
Press your brightness keys and monitor the system.log.

Patching the DSDT for Hotkeys


Once you get the methods which results to the brightness keys, you can patch your DSDT.

Assuming that _Q11 is brightness down, and _Q12 is up, as per the logs.

Open your DSDT and apply the patch
Code:
#Edit methods _Q11 and _Q12 to interface with KBC0 (or PS2K in some systems),
into method label _Q11 replace_content
begin
// Brightness Down\n
Notify (KBC0, 0x20)\n
end;

into method label _Q12 replace_content
begin
// Brightness Up\n
Notify (KBC0, 0x10)\n
end;

Notes :
  • Change the value of Keyboard according the IOReg found in your laptop. For e.g KBC0.
  • Change the value of corresponding keys according to the system.log. For e.g _Q11 for brightness down and _Q12 for down.

Restart your System


After performing all the above steps, restart your system for the applied changes to take effect.
Now you should be able to get your Intel UHD Graphics 1536 MB will full QE/CI. And your Dock would be also transparent.


Problem Reporting


Details:
  1. macOS version
  2. Copy of IOReg
  3. Kextcache output
Screen shots:
  • DPCIManager/Status
  • About This Mac
  • System Information/Graphics/Displays
  • System Preferences>Displays
Files:
  • For Clover, compress EFI/Clover, exclude the themes folder.
  • For OpenCore, compress EFI/OC.
  • ACPI dump
Notes:
  • Do not include complete EFI folder.
  • Put all files in a folder with your name, compress files as Zip and attach files using site attachments only.
  • Do not use any external links.


Credits:
RehabMan
Shinzon
EMlyDinEsH
 
Last edited:

marcinkk86

New member
Joined
Jun 7, 2020
Motherboard
Acer v3-371
CPU
Intel i5 5257u
Graphics
Intel iris6100
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
Hey, how do you set the keys to adjust the screen brightness on a laptop keyboard ?? Right now it's fn + f12 and fn + key pause. My bootloader is opencore. In my laptop acer v3-371, the shortcut from adjusting the screen brightness on the keyboard is the shortcut fn + left arrow key and fn + arrow right key.
 

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
Hey, how do you set the keys to adjust the screen brightness on a laptop keyboard ?? Right now it's fn + f12 and fn + key pause. My bootloader is opencore. In my laptop acer v3-371, the shortcut from adjusting the screen brightness on the keyboard is the shortcut fn + left arrow key and fn + arrow right key.
Use the above guide.
 

marcinkk86

New member
Joined
Jun 7, 2020
Motherboard
Acer v3-371
CPU
Intel i5 5257u
Graphics
Intel iris6100
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
I don't have a dsdt file, in the opencore tutorial they didn't use the dsdt file and didn't add this file to config.plist. I want to use it but don't act and I don't know what I'm doing wrong. https://github.com/jsassu20/OpenCore-HotPatching-Guide/tree/master/17-Brightness Shortcut Patch
You can use the DSDT in Clover and Open Core. The configuration is same but the patching process is same.

For more information on patching DSDT and SSDT, read here:
 

marcinkk86

New member
Joined
Jun 7, 2020
Motherboard
Acer v3-371
CPU
Intel i5 5257u
Graphics
Intel iris6100
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
You can use the DSDT in Clover and Open Core. The configuration is same but the patching process is same.

For more information on patching DSDT and SSDT, read here:
I understand but it's theoretically easier to make an ssdt patch than a dsdt and that's why I insist on it. I don't have a dsdt file and uploaded patches for dsdt.
 

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
I understand but it's theoretically easier to make an ssdt patch than a dsdt and that's why I insist on it. I don't have a dsdt file and uploaded patches for dsdt.
If you want to fix the issues, you'll have to follow the guides instructed here.
 

PippoX0

New member
Joined
Feb 9, 2020
Motherboard
Gygabyte H67-USB3
CPU
i5-2500k
Graphics
intel HD3000
OS X/macOS
10.15.x
Bootloader
  1. Clover (UEFI)
  2. Clover (Legacy)
  3. OpenCore
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Good to know !
I will give a try to see if i can use Fn key on my laptop
 
  • Like
Reactions: EliteMacx86

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS

Forum statistics

Threads
537
Messages
5,277
Members
4,704
Latest member
sequethin