Jump to content
4 posts in this topic

Recommended Posts

Many People gets confuse due to their wrong keyboard hotkeys or completely disabled hotkeys while using VoodooPS2Controller.kext. today I am writing a little guide for newbies to Enable Possible Every disabled Hotkeys on laptop with their personalised shortcuts.

 

Common Issues Can be Solved Using this guide:

  • Media Hotkeys not working
  • Brightness Hotkeys not working
  • Wrong keyboard entries
  • Completely dead keys
  • Bringing Every Windows hotkeys to Mac 

Basics:

While our laptop keyboards use PS2 Methods for input in windows, Mac Uses ADB Codes for Its Keyboard.VoodooPS2Controller convert those PS2 codes to Mac compatible ADB Codes. All the PS2 Scan codes for universal keys like ( A-z, 1-0, !-+) are same for almost every laptops but OEM Hotkeys are different. All laptop has Different Functional keys.So hot keys usually don't work properly without proper edits.

 

To Solve this issue First find the codes for your system then remap them to specific Mac ADB codes to do the same exact output in system.

 

(Note : I learned about all these things from different people and different posts, I will try to link Original Posts.)

!!Huge Thanks to RehabMan & All VoodooPS2Controller tester and developer!!

 

 

1.Check your Functional keys

  1. First of all you need to check wether your functional keys transmits PS2 or EC scan codes.
  2. Install latest version VoodooPS2 kext debug version, and watch your console while pressing keys.

A. PS2 Scan Codes

 

  • If It is a PS2 Scancode then you will get some report as like this.

(moniter Using ApplePS2 in search box and "NOW" option activated.)

ApplePS2.. : Sending e022=69 down
ApplePS2.. : Sending e022=69 up
  • The first value is your PS2 Scan codes and the value after equal to is the ADB code injected to system.
  • If nothing happens then it might be a EC Query.
  • VooDooPS2 Github Link

 

For e.g. my Play/Pause key sends e022=69 

Music Stop hotkey sends e024=80

Brightness key do not send anything so probably they are EC Controlled.

B. EC Queries

 

  • Install ACPI Debug kext: https://github.com/R...OS-X-ACPI-Debug
  • Open MaciASL and click on patch.(Add rehab man repo)
  • Apply "Add DSDT Debug Methods" and "Instrument EC Queries" Patch
  • Save the DSDT and restart
  • Now go to console and search for "ACPIDebug" and press those keys
  • ACPI Debug Github Link
  • You will get some result like this
ACPIDebug : EC _Q12

 

My Brightness Keys send _Q11 & _Q12

2.Get your new Keys

 

A.Direct ADB

  • Some hotkeys like play/pause, scan next track,Brightness,Lunchpad are exist in real Mac so you can find there ADB codes directly.
  • You can remap your hotkeys directly to those ADB Codes.
  • Some ADB Codes
Play/Pause : 34
Next Track : 42
Prev.Track : 4d
  • Others ADB codes can be found in this page.
  • You can check those ADB Codes you can easily. Convert the ADB codes to Decimal from hexadecial. While VOODooPS2 Debug version is installed,Hold the right alt and press the decimal value then leave the alt key and you can see the Executed ADB code.( For e.g. ADB code for next track is 34 so in decimal it will be 66. So press alt then type 66 and release the alt.your track will be changed in your music player)

 

so for me e022(My Playpause PS2 Scan Code) = 34 (ADB Code for Mac )

B. Extra Function Key

  • Some Hot keys like Lock windows,Print Screen,HP/Dell Support key, print, Multi monster setup are not present in Mac.
  • In that Case you need to Assign those hotkeys to function keys like (f15, f16,f17...f20). After that in Mac Keyboard shortcut preference you can set them for various commands 

(Note: take help of Automator to create more personalised shortcuts)

  • ADB Codes for function Keys
f16=6a
f17=40
f18=4f
f19=50
f20=5a

 

e.g. My Stop Key sends e024. I will map it to 4f (ADB for f18) .So that I can configure it to directly take screen shot in Mac preferences.

 

3.Remap Keys 

A. PS2 Codes

  • Go to your latest VoodooPS2 kext.
  • Detailed specification on Github Page.
  • Open " VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/info.plist" with Xcode or Plist Editor.
  • Go to Custom PS2 to ADB Map Section
  • Information Property List >> IOKitPersonalities >> ApplePS2Keyboard >> Platform Profile >> Default >> Custom ADB Map 
  • enter your PS2 Scancodes = ADB Value you want to use( In Hex)

  • <key>Custom ADB Map</key>        <array>
                <string>e022=34</string>
                <string>e024=4f</string>
            </array>

    For e.g. 

    e022=34 Means My Play hotkey will now send Proper Play ADB Value to System

    e024=4f Means My Stop hotkey now will send ADB Value of f18 to system.With help of Mac Keyboard Shortcut setting,

     

    Now I can use that stop (Fake f18) key to take screenShots.Or else with help of Automator App I can use it to lock my desktop.

B. EC Contolled Keys

  • With Proper DSDT Edit you can Notify to PS2M for any EC Controlled Queries.
  • Example for Brightness Fix (Original Post)

    into method label _Q11 replace_content
    begin
    // Brightness Down\n
    Notify(\_SB.PCI0.LPCB.PS2M, 0x0205)\n
    Notify(\_SB.PCI0.LPCB.PS2M, 0x0285)\n
    end;
    into method label _Q12 replace_content
    begin
    // Brightness Up\n
    Notify(\_SB.PCI0.LPCB.PS2M, 0x0206)\n
    Notify(\_SB.PCI0.LPCB.PS2M, 0x0286)\n
    end;
  • Custom EC Queries Shortcuts  can be done by similar process.(Will Be updated Soon)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi!
I'm trying to enable Brightness hotkeys on my laptop (Lenovo E580 (20KS003AXS)). I've already found out what is the EC queries for them (_Q14, _Q15).
At this moment I cannot properly patch DSDT for this keys.
Original one looks like:

Code:
            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x8000))
                {
                    \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1010)
                }

                If (\VIGD)
                {
                    Notify (\_SB.PCI0.GFX0.DD1F, 0x86)
                }
            }

I do not understand how to modify it. I've tried replacing method body with:
1) \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x0406)
2) Notify (\_SB.PCI0.GFX0.DD1F, 0x0406)
, but with no success.

Can someone help me to understand how to complete this?

debug_9200.zip

DSDT.dsl

Edited by dandepeched
Link to comment
Share on other sites

  • 1 year later...
On 5/6/2019 at 6:42 PM, dandepeched said:

Hi!
I'm trying to enable Brightness hotkeys on my laptop (Lenovo E580 (20KS003AXS)). I've already found out what is the EC queries for them (_Q14, _Q15).
At this moment I cannot properly patch DSDT for this keys.
Original one looks like:

Code:

            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x8000))
                {
                    \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1010)
                }

                If (\VIGD)
                {
                    Notify (\_SB.PCI0.GFX0.DD1F, 0x86)
                }
            }

I do not understand how to modify it. I've tried replacing method body with:
1) \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x0406)
2) Notify (\_SB.PCI0.GFX0.DD1F, 0x0406)
, but with no success.

Can someone help me to understand how to complete this?

debug_9200.zip

DSDT.dsl

 

Hi, here is my modification: 

 

            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (_OSI ("Darwin"))
                {
                    Notify(\_SB.PCI0.LPCB.PS2K, 0x0405)    // e0 05 -> F14
                    Notify(\_SB.PCI0.LPCB.PS2K, 0x20)
                }
                Else
                {
                    If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x8000))
                    {
                        \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1010)
                    }

                    If (\VIGD)
                    {
                        Notify (\_SB.PCI0.GFX0.DD1F, 0x86)
                    }
                }
            }

            Method (_Q15, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (_OSI ("Darwin"))
                {
                    Notify(\_SB.PCI0.LPCB.PS2K, 0x0406)    // e0 06 -> F15
                    Notify(\_SB.PCI0.LPCB.PS2K, 0x20)
                }
                Else
                {
                    If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x00010000))
                    {
                        \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1011)
                    }

                    If (\VIGD)
                    {
                        Notify (\_SB.PCI0.GFX0.DD1F, 0x87)
                    }
                }
                Return (Zero)
            }

And remember to add SSDT-PNLF.aml with WhateverGreen.kext to enable brightness control.

 

Or you can patch that key with hotpatch.

 

// Rename in Opencore or Clover ACPI section
// [BKey]_Q14 to XQ14
// Find:     5F513134 00
// Replace:  58513134 00
//
// [BKey]_Q15 to XQ15
// Find:     5F513135 00
// Replace:  58513135 00
DefinitionBlock("", "SSDT", 2, "ERIC", "BrightFN", 0)
{
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    External(_SB.PCI0.LPCB.EC, DeviceObj)
    External(_SB.PCI0.LPCB.EC.XQ14, MethodObj)
    External(_SB.PCI0.LPCB.EC.XQ15, MethodObj)
    
    Scope (_SB.PCI0.LPCB.EC)
    {
        Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
        {
            If (_OSI ("Darwin"))
            {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405)    // e0 05 -> F14
                Notify(\_SB.PCI0.LPCB.PS2K, 0x20)
            }
            Else
            {
                XQ14()
            }
        }

        Method (_Q15, 0, NotSerialized)  // _Qxx: EC Query
        {
            If (_OSI ("Darwin"))
            {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406)    // e0 06 -> F15
                Notify(\_SB.PCI0.LPCB.PS2K, 0x20)
            }
            Else
            {
                Return (XQ15())
            }
        }
    }
}

 

Link to comment
Share on other sites

  • 3 months later...
 Share

×
×
  • Create New...