Doesn't work in Mountain Lion? #8

Leask opened this Issue Mar 18, 2012 · 41 comments

It seems like that, anyway to make it work again?


Still no updates?


@macx they won't get the source till 10.8 is released. That may be July, but is your best source for that sort of information.


AFAIK the current one is already GM, so it should be ok to start your work :P I can't live without this :)


The source code is not released. As already mentioned, this will not happen until the public release of the OS.


it seems the only difference between 10.6 and 10.7 kext is:

+#define     kEjectKeyDelayMS        100     // the delay for a dedicated eject key
+#define     kEjectF12DelayMS        250     // the delay for an F12/eject key

If you load the 10.7 kext on 10.8 it'll work (only tested caps lock remapping).


@fbuenemann could you explain how do this right ? and where i can get kext ?


I extracted PCKeyboardHack.10.7.kext using Pacifist, moved it to /System/Library/Extensions/PCKeyboardHack.kext and loaded it using kexktutil. Make sure it's owned by root:wheel, or loading will fail.

If you don't know how to enter single user to debug problems, you're probably better off waiting for a new release.


To add to fbuenemann's comment, I was also able to get PCKeyboardHack for 10.7 to work with Mountain Lion by using the 10.7 kext. I'm using a couple remappings and everything seems to work great.

These are the steps I followed to make it work:

  1. Download and Install PCKeyboardHack for 10.7
  2. Restart
  3. Edit (as sudo): /Library/org.pqrs/PCKeyboardHack/scripts/ (see below)
  4. Restart

I hope this helps!


PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH

uname=`uname -r`
case "${uname%%.*}" in
        kextfile="$basedir/PCKeyboardHack.10.7.kext" # Hack to use 10.7 kext in 10.8

if [ "x$kextfile" == 'x' ]; then
    exit 1

if [ "$1" == 'unload' ]; then
    kextunload -b org.pqrs.driver.PCKeyboardHack
    kextload "$kextfile"

exit 0

Thanks @joshskidmoreadding those three lines worked a treat!

(Running 10.8 GM Seed)


@joshskidmore You are a prince. Back to coding for me!


I used the code above from joshskidmore but got a python error while trying to use sudo to update the file.

So, I had to do this:

cd /Library/org.pqrs/PCKeyboardHack/scripts
sudo chown adam:wheel
vim (edited the file)
sudo chown root:wheel

Thanks! Vim-sanity is restored!


I can't live without this as you.

The adding 12) line seems working for me, too.

Though, I understand the author's conservative attitude.

Thanks takezo and folks!!



@joshskidmore It works like a charm.


I'm still trying to figure out why it keeps looking for the 10.6 kext/SDK.


Would someone mind explaining how to edit the file as sudo? Thank you in advance.


@drsethl in a terminal window, do sudo vim /Library/org.pqrs/PCKeyboardHack/scripts/ (replacing vim with your favorite editor).


no luck here. It seems to kill the preferences pane so I can't edit anything


thanks @tnorthcutt. I don’t have an editor installed (unless there's one included with Mountain Lion?). Googled and found MacVim, but don’t know how to use it with Sudo. Any more advice appreciated, thanks for the time.


You don't actually need to substitute something for vim - it's included and should work fine. You may need to read up on how to edit a file with it.


PC Keyboard Hack on OS X 10.8 Mountain Lion


sudo curl \
    -L \
    -o /Library/org.pqrs/PCKeyboardHack/scripts/


  1. Open Terminal, iTerm, or whatever you use.

  2. Install PCKeyboardHack for OS X 10.7

  3. For safety's sake, inspect the current kext loader

    cat /Library/org.pqrs/PCKeyboardHack/scripts/
  4. For safety's sake, inspect the updated kext loader

  5. Copy the updated kext loader over the original

    sudo curl \
        -L \
        -o /Library/org.pqrs/PCKeyboardHack/scripts/
  6. Now verify that the file is what you expect:

    cat /Library/org.pqrs/PCKeyboardHack/scripts/
  7. REBOOT!


@coolaj86 You are an absolute legend, thank you mate!


@Leask will you please edit your original post to include the solution in my comment #8 (comment) right up at the top where it's easy for people to get at?


ignore my earlier comment. It started working after a couple of reboots. Not sure why the preferences pane was temporarily broken.


As knu stated, it is out, will we see an updated version soon?


This is amazing. Thank you so much!


Worked perfectly. Thank you!


@coolaj86 Nice one thank you!


The source code for 10.8 has been published:


I've released PCKeyboardHack for OS X 10.8.

@tekezo tekezo closed this Aug 11, 2012

Thank you tekezo for your support!


I second that--thanks so much for your efforts!


Thank you tekezo! Caps Lock = Esc again :)


This is broken again for mountain lion 1.8.2, should i open a new issue?
Oh i should mention i'm on a Macbook Pro with retina display.
I think mine is a special case, because it does work with the builtin keyboard, but not with an external one.
It was microsoft's software to control the keyboard messing with pckeyboardhack. I uninstalled it and the problem is solved.


KeyRemap4MacBook and PCKeyboardHack grab key events from keyboard driver.
Therefore, they depend the keyboard driver implementation.
It's a essential limitation that KeyRemap4MacBook and PCKeyboardHack might not work on some third vendor drivers such as Microsoft's IntelliType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment