Jump to content
soumaxetuirk

GUIDE: How to Fix Brightness hotkeys in DSDT

101 posts in this topic

Recommended Posts

So call me lazy or just plain stupid but I couldn't get the right codes for me to modify either my DSDT/SSDT or my VoodooPS2Controller.kext so I just used the El Capitan HID kexts (install/repair/rebuild) and that restored my function keys for brightness up and down, as well as all other function keys and OS X keyboard shortcuts.  Here's the kexts I replaced:

 

IOHIDFamily.kext

AppleHIDKeyboard.kext

AppleHIDMouse.kext

 

I made sure to save 10.12.1 version of those kexts before installing the El Cap version.  I feel like a cheater but I'll take it for now and try again when time and my willingness permits.

 

For those who do not have the El Cap version of the HID kexts, here they are:

 

El Cap HID.zip

Share this post


Link to post
Share on other sites
Advertisement

It turns out that the only kext needed to restore F key functions is the El Cap version of IOHIDFamily.kext.  However, while function keys are restored, I lost lid and power button functions.  Closing the lid does not put the laptop to sleep, although selecting sleep from the shutdown options in the menu does.  Likewise, pressing the power button does not make the video sleep nor does it call up the shutdown/restart/sleep window.  I don't really think that using the El Cap HID kext is a good solution.

Share this post


Link to post
Share on other sites

It is best to change the keyboard driver such that it generates F14/F15 instead of the real brightness ADB codes.

In my driver, can be done in ACPI. Not sure about other drivers.

 

I understand your suggestion but I am determined to find the code that changes brightness down for my laptop.  Again, my F2 key (brightness down) is HKNO 7 and my F3 key (brightness up) is HKNO 8 (both in H_EC/_Q13).  Brightness up is now 0x0205 and 0x0285 (not 0x0206 and 0x0286).  It sends the key e005=91 up and down.  The code 0x0405 produces the same result.

 

Brightness down does not work.  If anyone running a pre-Sierra OS on a HP Envy 17 can post what key is sent using brightness down when it works, I can mess with the numbers to try to get that code to be sent when I press my F2 key.  Alternatively, the key that is called in Sierra may not be the key that was called in previous versions of OS X.  

 

Might there be another way to get to the same result?

Share this post


Link to post
Share on other sites

OK, I was able to get my brightness keys to work correctly.  I borrowed code from RehabMan's proposed use of F14/F15 but applied it to my brightness keys - F2/F3.  Here's the code that I have in my DSDT under _SB.PCI0.LPCB.H_EC:

                    Method (_Q13, 0, NotSerialized)
                    {
                        Store (HKNO, Local0)
                        If (LEqual (Local0, 0x07))
                        {
                            Notify (PS2K, 0x0365)
                        }

                        If (LEqual (Local0, 0x08))
                        {
                            Notify (PS2K, 0x0366)
                        }
                    }

When I press F2 (brightness down), it sends key 65=6b up and down.  When I press F3 (brightness up), it sends key 66=71 up and down.

Share this post


Link to post
Share on other sites

I understand your suggestion but I am determined to find the code that changes brightness down for my laptop.  Again, my F2 key (brightness down) is HKNO 7 and my F3 key (brightness up) is HKNO 8 (both in H_EC/_Q13).  Brightness up is now 0x0205 and 0x0285 (not 0x0206 and 0x0286).  It sends the key e005=91 up and down.  The code 0x0405 produces the same result.

 

Brightness down does not work.  If anyone running a pre-Sierra OS on a HP Envy 17 can post what key is sent using brightness down when it works, I can mess with the numbers to try to get that code to be sent when I press my F2 key.  Alternatively, the key that is called in Sierra may not be the key that was called in previous versions of OS X.  

 

Might there be another way to get to the same result?

Don't use PS2 codes that correspond to actual brightness up/down ADB. Use PS2 codes that correspond to ADB for F14/F15.

Share this post


Link to post
Share on other sites

Yes, note PS2->ADB mapping in ApplePS2ToADBMap.h:

    0x6b,   // 65  F14
    0x71,   // 66  F15

 

So I guess my only contribution, if any, was mapping these to my F2/F3 keys by way of a DSDT patch.

Share this post


Link to post
Share on other sites

So I guess my only contribution, if any, was mapping these to my F2/F3 keys by way of a DSDT patch.

DSDT patch maps your brightness keys (presumably Fn+F2/Fn+F3). F2/F3 use standard scan codes that map to standard ADB codes.

 

Note: Some BIOS/EC will reverse the function of Fn+F1-F12 with F1-F12. But it PS2/ACPI-wise, you're still pressing Fn+F2/Fn+F3...

Share this post


Link to post
Share on other sites

DSDT patch maps your brightness keys (presumably Fn+F2/Fn+F3). F2/F3 use standard scan codes that map to standard ADB codes.

 

Note: Some BIOS/EC will reverse the function of Fn+F1-F12 with F1-F12. But it PS2/ACPI-wise, you're still pressing Fn+F2/Fn+F3...

 

That's correct.  HP has a feature in BIOS to allow switching that is enabled by default.  It allows you to use the function keys without pressing the Fn key.

 

BTW, on a somewhat related matter, I don't know if you are aware of this but, if I press F5, which is the on/off switch for keyboard backlighting, and hold it down while pressing the arrow up/down keys, it will change the brightness of the keyboard backlighting.  

Share this post


Link to post
Share on other sites

BTW, on a somewhat related matter, I don't know if you are aware of this but, if I press F5, which is the on/off switch for keyboard backlighting, and hold it down while pressing the arrow up/down keys, it will change the brightness of the keyboard backlighting.

I don't have any HP laptops with a keyboard backlight, so this matters very little to me...

But it seems like a reasonable key assignment.

Share this post


Link to post
Share on other sites

So i patched my DSDT for ec queries etc and have found that my brightness up is _Q0F and brightness down is _QOE but when i apply those changes to 

into method label _Q1D replace_content
begin
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0205)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0285)\n
end;
into method label _Q1C replace_content
begin
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0206)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0286)\n
end;

like this

into method label _Q0E replace_content
begin
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0205)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0285)\n
end;
into method label _Q0F replace_content
begin
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0206)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0286)\n
end;

brightness down doesnt do anything except bring up the brightness splash and brightness up does the same but also flashes the sound mute as well. So no brightness control.

Brightness slider works etc as i was using asusnbfnkeys but want to steer away from that.

Brightness up is f6 and down is f5

 

Volume control works with fn+f11 + f12 f10 for mute.

 

What have i missed for brightness control via fn + f5 & f6?

 

DSDT attached

DSDT.aml.zip

Share this post


Link to post
Share on other sites

brightness down doesnt do anything except bring up the brightness splash and brightness up does the same but also flashes the sound mute as well. So no brightness control.

Sounds like 10.12.1.

You should generate keys for F14/F15 instead of brightness key codes.

Share this post


Link to post
Share on other sites

Yes it is.

How do i go about doing that?

I wrote about it in my backlight guide on another website. You can use google to find it.

Share this post


Link to post
Share on other sites

Thanks @RehabMan i ended up using

into method label _Q0E replace_content
begin
// Brightness Down\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0365) //F14\n
end;
into method label _Q0F replace_content
begin
// Brightness Up\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0366) //F15\n
end;

And all is well.

Share this post


Link to post
Share on other sites

Thanks @RehabMan i ended up using

into method label _Q0E replace_content
begin
// Brightness Down\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0365) //F14\n
end;
into method label _Q0F replace_content
begin
// Brightness Up\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0366) //F15\n
end;
And all is well.

 

Yes... as per my guide :-)

Share this post


Link to post
Share on other sites

Can anyone confirm brightness keys broken as of beta 6?

Working just fine here (with brightness keys generating F14/F15).

Share this post


Link to post
Share on other sites

Hi,

 

I'm trying to fix ASUS UX430UA keyboard backlighting.

 

- brightness works on FN+F5/6(16 levels)
- keyboard backlight does not working

backlight
FN+F3 down -> ACPIDebug: "EC _Q0C enter" and "exit"
FN+F4 up -> ACPIDebug: "EC _Q0D enter" and "exit"

brightness
FN+F5 down -> ACPIDebug: "EC _Q0E enter" and "exit"
FN+F6 up -> ACPIDebug: "EC _Q0F enter" and "exit"

FN press:
default 14:03:37.805566 +0200 kernel ACPIDebug: "EC _QD3 enter"
default 14:03:37.805780 +0200 kernel ACPIDebug: "EC _QD3 exit"
default 14:03:37.944475 +0200 kernel ACPIDebug: "EC _QD4 enter"
default 14:03:37.944693 +0200 kernel ACPIDebug: "EC _QD4 exit"

 

any ideas how to fix keyboard backlight ?

 

 

from console:

default    22:58:47.421968 +0200    kernel    AsusNBFnKeys: Failed to set Keyboard backlight to level 0xe.
default    22:58:48.122215 +0200    kernel    AsusNBFnKeys: Failed to set Keyboard backlight to level 0xf.
default    22:58:48.448304 +0200    kernel    AsusNBFnKeys: Failed to set Keyboard backlight to level 0xe.
default    22:58:48.759530 +0200    kernel    AsusNBFnKeys: Failed to set Keyboard backlight to level 0xf.
default    22:58:49.079320 +0200    kernel    AsusNBFnKeys: Failed to set Keyboard backlight to level 0xe.

Thank you

 

 

EDIT:

 

keyboard backlights works fine now with patch from EMlyDinEsH

 

 

# Patch by EMlyDinEsH (www.osxlatitude.com)
 
#
# Enables 4 keyboard backlight levels control to work using my kexts AsusNBFnKeys and Smart Touchpad
# This patch meant for Kabylake notebooks and may work for others.
#
 
# Insert backlight auto off control sync field for Smart Touchpad and Asus Fn Keys driver
into device label ATKD code_regex Name\s\(BOFF,\sZero\) remove_matched;
into device label ATKD insert begin Name (BOFF, Zero) end;
 
# Insert method SKBL for setting keyboard backlight level
into method label SKBL parent_label ATKD remove_entry;
into Device label ATKD insert begin
Method (SKBL, 1, NotSerialized)\n
            {\n
                If (Or (LEqual (Arg0, 0xED), LEqual (Arg0, 0xFD)))\n
                {\n
                    If (And (LEqual (Arg0, 0xED), LEqual (BOFF, 0xEA)))\n
                    {\n
                        Store (Zero, Local0)\n
                        Store (Arg0, BOFF)\n
                    }\n
                    Else\n
                    {\n
                        If (And (LEqual (Arg0, 0xFD), LEqual (BOFF, 0xFA)))\n
                        {\n
                            Store (Zero, Local0)\n
                            Store (Arg0, BOFF)\n
                        }\n
                        Else\n
                        {\n
                            Return (BOFF)\n
                        }\n
                    }\n
                }\n
                Else\n
                {\n
                    If (Or (LEqual (Arg0, 0xEA), LEqual (Arg0, 0xFA)))\n
                    {\n
                        Store (Arg0, BOFF)\n
                    }\n
                    Else\n
                    {\n
Store (And (Arg0, 0x7F), KBLV)\n
                    }\n
                }\n
Store (0x0900, Local0)\n
          Add (Local0, 0xF0, Local0)\n
          \_SB.PCI0.LPCB.EC0.WRAM (Local0, KBLV)\n
         Store (DerefOf (Index (PWKB, KBLV)), Local0)\n
            \_SB.PCI0.LPCB.EC0.ST9E (0x1F, 0xFF, Local0)\n
                Return (Local0)\n
            }\n
end;
 
# Remove existing 16 backlight levels list if exist
into device label ATKD code_regex Name\s\(KBPW,\sBuffer\s\(0x10\)\s*\n\s*\{\s*\/\*\s0000\s\*\/\s*0x00,\s0x11,\s0x22,\s0x33,\s0x44,\s0x55,\s0x66,\s0x77,\s*\/\*\s0008\s\*\/\s*\s0x88,\s0x99,\s0xAA,\s0xBB,\s0xCC,\s0xDD,\s0xEE,\s0xFF\s*\}\) remove_matched;
# Remove existing 4 backlight levels list if exist
into device label ATKD code_regex Name\s\(PWKB,\sBuffer\s\(0x04\)\s*\n\s*\{\s*0x00,\s0x55,\s0xAA,\s0xFF\s*\}\) remove_matched;
 
# Insert 4 backlight levels
into Device label ATKD insert begin
Name (PWKB, Buffer (0x04)\n
            {\n
               0x00, 0x55, 0xAA, 0xFF\n
            })\n
end;
 
 
# Insert method GKBL for reading keyboard backlight level
into method label GKBL parent_label ATKD remove_entry;
into Device label ATKD insert begin
Method (GKBL, 1, NotSerialized)\n
            {\n
               If (LEqual (Arg0, 0xFF))\n
                {\n
                    Return (BOFF)\n
                }\n
 
                Return (KBLV)\n
            }\n
end;

Gulios-UX430UA-latest.zip

Share this post


Link to post
Share on other sites

Hi there,

Could someone help me with trying to remap my brightness control keys on my Dell Latitude E5430 Non v-Pro running Sierra 10.12.6? They are currently mapped to Fn + F3 (darken) and Fn + Insert (brighten) and would like to get them mapped to Fn + Cursor Down and Fn + Cursor Up respectively.

I have tried to get ACPIDebug to work but just don't seem to get any kind of key codes to appear in system.log, despite ACPIDebug being loaded via /S/L/E (confirmed by Kext Wizard) and having patched my DSDT with these patched from RehabMan...

 

Add DSDT Debug Method

Instrument EC Queries
Instrument GPE Events

I've also tried VoodooPS2Control-R6 and another VoodooPS2Controller kext (which both get my trackpad working) inconjunction with the debugger but to no avail.

I've attached my current DSDT and the two kexts I've tried in case I have missed something or those kexts are no good for the debugger. If you need any further info about my config please let me know.

 

Cheers,



  

VoodooPS2 Kexts.zip

DSDT_amox.dsl.zip

Share this post


Link to post
Share on other sites

Further to my last post, not sure why but by turning on the legacy boot option in the BIOS so that I could boot off the DVD drive seems to have activated the Fn + Cursor Up / Down brightness control keys when OSX has booted, albeit it doesn't show the brightness graphic (but Fn + F3 and Fn + Insert still work and show the graphic bar), so it's like I now have two brightness controls that are independent of each other!?

Still haven't been able to generate the key codes, but thought I would add this development in case it has some significance.

Edited by amoxitine

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MaLd0n
      ---INSTALLATION TUTORIAL---
       
      ---Original Post---
      https://olarila.com/forum/viewtopic.php?f=45&t=9172
       
      ---USB---
      https://pikeralpha.wordpress.com/2016/07/13/simple-skylake-usb-fix-no-kexts-required/
       
      ---CLOVER FOLDER---
       
      CLOVER.zip
       
       
      --MOBO
      GigaByte Z390 M Gaming



      --PROCESSOR
      Intel Core i9-9900K


      --COOLER
      CoolerMaster MasterLiquid ML120R RGB


      --MEMORY
      Corsair Dominator Platinum 16GB (2 x 8GB)


      --GPU
      Sapphiretech Radeon RX 590 8 GB GDDR5


       
      --SSD
      Samsung 970 EVO NVMe M2 Flash Drive


      --POWER SUPPLY
      EVGA 750 N1, 750W


      --WIRELESS
      TP-Link Archer T9E


      --BLUETOOTH
      Orico BTA-403


      --CASE
      Thermaltake View 21 Tempered Glass Edition


      --DSDT Patches--
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE 10 ID -DMAC -REMOVE 22K LINES, PROBLEMATIC and UNUSED -FIX K.P in REBOOT -NVRAM / REAL TIME CLOCK -SLPB -DARWIN / WINDOWS 2015 -XHCI -PLUGIN TYPE -HDAS to HDEF -HDEF -REAL TIME CLOCK -ARTC -IRQs -SBUS -MIKEY -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -PMCR -PPMC -XSPI -GMM -IMEI -EC -PNLF -ARPT -GFX0 -NVME -DTGP -ACQUIRE MUT0 0XFFFF -OPERATION REGION GPIO -MUTEX MUT0 0x00 -EXTERNAL REFERENCES -UNKNOWNOBJ -HDMI / HDAU -FULL RENAMED DEVICES  
      --SCREENSHOTS--





























      --BruceX--
       
      --USB-C-- test with SanDisk Ultra USB-STICK 128gb


       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad, Sampath007, onemanosx, erroruser, Jenny David, Olarila Facebook Community, Hackintosh Facebook Community and many others!
      We're all here to have fun and learn from each other!
    • By AppleBytes
      Hello,
      I'm working on a re-install of OSX on a dell inspiron 9400. I was finally able to get a copy of SL on it. But it still needs MUCH work, as the graphics (NVIDIA Geforce Go 7800) isn't properly recognized -- either by model, or installed VRAM.
      It has 512Mb, but only initializes 256Mb VESA.
      Anyway, as a start, I thought it best to use a valid dsdt.dsl for compilation, and start there. I've managed to remove all the warnings, and errors save 2
      OUTPUT:
      # sudo iasl -ta ./dsdt.dslll Intel ACPI Component Architecture ASL Optimizing Compiler version 20110527-64 [May 27 2011] Copyright (c) 2000 - 2011 Intel Corporation ./dsdt.dslll   3519:                                 Return (0x00) Error    4080 -           Invalid object type for reserved name ^  (found INTEGER, requires Buffer) ./dsdt.dslll   3956:                     Return (Package (0x00) {}) Remark   5072 -         Effective AML package length is zero ^ ASL Input:  ./dsdt.dslll - 4997 lines, 158533 bytes, 1633 keywords Compilation complete. 1 Errors, 0 Warnings, 1 Remarks, 577 Optimizations I'm attaching a copy of the above output, and the dsdt.dsl file in a tarball to this post in hopes someone with the required knowledge can help me fix it.
      FWIW
      SMBIOS I'm using indicates this is a MBP 3,1
      cpu: cd2 (T7400 @2.16Ghz)
      graphics: NVIDIA Geforce Go 7800 ( G70M? )
      ram: 4Gb
      dell inspiron 9400 (Laptop)
       
      Thank you for all your time, and consideration!
       
      --Chris
       
      DSDT-DSL.tar
    • By RagK
      Hey , I have installed MacOS Mojave on my desktop
       I am facing issue in which the front pane USB ports on my cpu are working only after a reboot.
       
      When I start my PC after a shut down the USB ports docent seem to work as USB pen drive is not detected 
       
      Please Help
    • By RagK
      Hey I am running Mojave on my Desktop
       
      I am facing this issue after I open AppStore Can't connect to App Store
       
      I am using USB Tethering from an android phone after installing HoRNDIS-9.2
       
      Also I wrote this Post on my Mac so there is no problem of internet 
       
      I have also added this screenshot .
       
      Please Help to your fullest ! 

×