Contribute
Register

Swapped Caps-Lock and Control Causes Locked Control

Status
Not open for further replies.
Joined
Oct 23, 2013
Messages
7
Motherboard
HP Envy 17-u177cl Laptop (Clover)
CPU
i7-7500U
Graphics
Intel HD620/NVIDIA 940MX, 1920x1080
Everything is working well finally on my HP Envy with High Sierra except for one thing...

I always use the caps-lock key as my control key. When I swap caps lock and control using either the Apple keyboard control panel or Karabiner Elements, when I press the caps-lock key (which is now control) it lights up (it has an LED in it) and at that point it locks control on so that every key I press is control modified. And it will not turn off. If I hit the caps-lock key again it does not turn off. LED stays lit and keys are all still control modified.

I have a bad feeling the keyboard controller is managing caps lock and so the OS has no control over this locking behavior.

I am using v1.8.29 of VoodooPS2Controller by RehabMan installed in /CLOVER/kexts/Other.

Anyone have any ideas how to fix this?
-Thanks, Kramer
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,477
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Everything is working well finally on my HP Envy with High Sierra except for one thing...

I always use the caps-lock key as my control key. When I swap caps lock and control using either the Apple keyboard control panel or Karabiner Elements, when I press the caps-lock key (which is now control) it lights up (it has an LED in it) and at that point it locks control on so that every key I press is control modified. And it will not turn off. If I hit the caps-lock key again it does not turn off. LED stays lit and keys are all still control modified.

I have a bad feeling the keyboard controller is managing caps lock and so the OS has no control over this locking behavior.

I am using v1.8.29 of VoodooPS2Controller by RehabMan installed in /CLOVER/kexts/Other.

Anyone have any ideas how to fix this?
-Thanks, Kramer

You cannot swap via SysPrefs (due to workaround for capslock bug introduced in Sierra).
But you can do it with ACPI overrides for VoodooPS2 keyboard mapping.

For example:
Code:
// This sample shows how to remap the Left Control to CapsLock,
// and CapsLock to Left Control.
DefinitionBlock ("", "SSDT", 2, "hack", "ps2", 0)
{
    Name(_SB.PCI0.LPCB.PS2K.RMCF, Package()
    {
        "Keyboard", Package()
        {
            "Custom ADB Map", Package()
            {
                Package(){},
                "3a=3b",    // 3a is PS2 for capslock, 3b is ADB for left control (normal map is 3a=39)
                "1d=39",    // 1d is PS2 for left control, 39 is ADB for caps lock (normal map is 1d=3b)
            },
        },
    })
}
//EOF

You will need to verify the ACPI patch of your keyboard device (typically it is _SB.PCI0.LPCB.PS2K, but not always).
 
Joined
Oct 23, 2013
Messages
7
Motherboard
HP Envy 17-u177cl Laptop (Clover)
CPU
i7-7500U
Graphics
Intel HD620/NVIDIA 940MX, 1920x1080
You cannot swap via SysPrefs (due to workaround for capslock bug introduced in Sierra).
But you can do it with ACPI overrides for VoodooPS2 keyboard mapping.

For example:
Code:
// This sample shows how to remap the Left Control to CapsLock,
// and CapsLock to Left Control.
DefinitionBlock ("", "SSDT", 2, "hack", "ps2", 0)
{
    Name(_SB.PCI0.LPCB.PS2K.RMCF, Package()
    {
        "Keyboard", Package()
        {
            "Custom ADB Map", Package()
            {
                Package(){},
                "3a=3b",    // 3a is PS2 for capslock, 3b is ADB for left control (normal map is 3a=39)
                "1d=39",    // 1d is PS2 for left control, 39 is ADB for caps lock (normal map is 1d=3b)
            },
        },
    })
}
//EOF

You will need to verify the ACPI patch of your keyboard device (typically it is _SB.PCI0.LPCB.PS2K, but not always).

Thanks RehabMan. I was about to implement what you suggested and noticed that Caps-Lock was working as control. What? Then I remembered that I had tried editing the Info.plist in VoodooPS2Keyboard.kext and setting the key "Swap capslock and left control" to true last night. It did not seem to work after a reboot. But I was unwisely doing multiple changes at once and must have messed up my testing. So the good news is that an edit to the Info.plist in the great VoodooPS2 fixed my problem! Here is the diff from the stock VoodooPS2 to my swapping version for anyone else who cares to try that:

Code:
*** RehabMan-Voodoo-2017-1130/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist
--- VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist
***************
*** 310,316 ****
  <key>SleepPressTime</key>
  <integer>0</integer>
  <key>Swap capslock and left control</key>
! <false/>
  <key>Swap command and option</key>
  <true/>
  <key>Use ISO layout keyboard</key>
--- 310,316 ----
  <key>SleepPressTime</key>
  <integer>0</integer>
  <key>Swap capslock and left control</key>
! <true/>
  <key>Swap command and option</key>
  <true/>
  <key>Use ISO layout keyboard</key>
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,477
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Thanks RehabMan. I was about to implement what you suggested and noticed that Caps-Lock was working as control. What? Then I remembered that I had tried editing the Info.plist in VoodooPS2Keyboard.kext and setting the key "Swap capslock and left control" to true last night. It did not seem to work after a reboot. But I was unwisely doing multiple changes at once and must have messed up my testing. So the good news is that an edit to the Info.plist in the great VoodooPS2 fixed my problem! Here is the diff from the stock VoodooPS2 to my swapping version for anyone else who cares to try that:

Code:
*** RehabMan-Voodoo-2017-1130/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist
--- VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist
***************
*** 310,316 ****
  <key>SleepPressTime</key>
  <integer>0</integer>
  <key>Swap capslock and left control</key>
! <false/>
  <key>Swap command and option</key>
  <true/>
  <key>Use ISO layout keyboard</key>
--- 310,316 ----
  <key>SleepPressTime</key>
  <integer>0</integer>
  <key>Swap capslock and left control</key>
! <true/>
  <key>Swap command and option</key>
  <true/>
  <key>Use ISO layout keyboard</key>

I recommend swapping via the method I posted in #2.
Leave the Info.plist as provided from my bitbucket site.
Doing it with ACPI will make updates of the kext easier for you...
 
Joined
Oct 23, 2013
Messages
7
Motherboard
HP Envy 17-u177cl Laptop (Clover)
CPU
i7-7500U
Graphics
Intel HD620/NVIDIA 940MX, 1920x1080
I recommend swapping via the method I posted in #2.
Leave the Info.plist as provided from my bitbucket site.
Doing it with ACPI will make updates of the kext easier for you...
Understood. In the interim I also ended up modifying the FingerZ parameter for the trackpad to try to avoid spurious touches while typing. Might also need to adjust the touch "zones" as well. So it seems I will need to maintain a list of patches to apply when updating these kexts. But I understand your warning. Thanks for your help and all you have done to support the community!
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,477
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Understood. In the interim I also ended up modifying the FingerZ parameter for the trackpad to try to avoid spurious touches while typing. Might also need to adjust the touch "zones" as well. So it seems I will need to maintain a list of patches to apply when updating these kexts. But I understand your warning. Thanks for your help and all you have done to support the community!

Trackpad settings such as FingerZ can also be changed via ACPI/SSDT.
(anything in IOKitPersonalities/Info.plist can be changed via ACPI/SSDT/RMCF)

See examples in my github projects.
 
Joined
Jan 8, 2015
Messages
88
Motherboard
Gigabyte Z390 Aorus Pro-F12d
CPU
i9-9900K
Graphics
Radeon VII
Mac
  1. MacBook Air
  2. Mac Pro
Mobile Phone
  1. Android
Could I get some more details on the ACPI override solution? I tried it (as far as I can tell what I was supposed to do), but it didn't work. I put the text into a .dsl file, and compiled it with:
~/Library/ssdtPRGen/Tools/iasl -vw 2095 -vw 2146 -vw 2089 -vw 4089 -vi -vr -pSSDT-NO-CAPSLOCK.aml SSDT-NO-CAPSLOCK.dsl
And put it into the CLOVER/ACPI/patched directory, but it had no effect. I tried some slightly different syntax too based on stuff I saw elsewhere but that didn't help either:

Code:
    ...
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    Scope (_SB.PCI0.LPCB.PS2K)
    {
        Name(RMCF, Package()
    ...

Was this the right thing or are there additional steps. And how do I verify the ACPI path of the keyboard device. I rummaged through the ioreg output and didn't come up with anything helpful there.

tom
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,477
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Could I get some more details on the ACPI override solution? I tried it (as far as I can tell what I was supposed to do), but it didn't work. I put the text into a .dsl file, and compiled it with:
~/Library/ssdtPRGen/Tools/iasl -vw 2095 -vw 2146 -vw 2089 -vw 4089 -vi -vr -pSSDT-NO-CAPSLOCK.aml SSDT-NO-CAPSLOCK.dsl
And put it into the CLOVER/ACPI/patched directory, but it had no effect. I tried some slightly different syntax too based on stuff I saw elsewhere but that didn't help either:

Code:
    ...
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    Scope (_SB.PCI0.LPCB.PS2K)
    {
        Name(RMCF, Package()
    ...

Was this the right thing or are there additional steps. And how do I verify the ACPI path of the keyboard device. I rummaged through the ioreg output and didn't come up with anything helpful there.

tom

No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
 
Joined
Nov 24, 2013
Messages
4
Motherboard
cxv
CPU
xzcv
Graphics
cvxz
Mac
  1. MacBook Air
Classic Mac
  1. Classic
Mobile Phone
  1. Android
it's look complicated do you have other way to make it work because i am a new hackintosh so i don't understand
 
Status
Not open for further replies.
Top