Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Doesn't work in Mountain Lion? #8

Closed
Leask opened this Issue March 18, 2012 · 41 comments
Leask Huang
Leask commented March 18, 2012

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

Takayama Fumihiko
Owner
Leask Huang
Leask commented March 18, 2012
David Maciejewski
macx commented June 12, 2012

Still no updates?

John McDonnell

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

Miha Rekar
mrfoto commented July 07, 2012

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

Dean Herbert
peppy commented July 07, 2012

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

olfway
olfway commented July 10, 2012

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
Felix Bünemann

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

Anton Shemerey

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

Leask Huang
Leask commented July 12, 2012
Felix Bünemann

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.

Josh Skidmore

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/kext.sh (see below)
  4. Restart

I hope this helps!
-Josh

/Library/org.pqrs/PCKeyboardHack/scripts/kext.sh:

#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH

basedir="/Library/org.pqrs/PCKeyboardHack"
kextfile=''
uname=`uname -r`
case "${uname%%.*}" in
    10)
        kextfile="$basedir/PCKeyboardHack.10.6.kext"
        ;;
    11)
        kextfile="$basedir/PCKeyboardHack.10.7.kext"
        ;;
    12)
        kextfile="$basedir/PCKeyboardHack.10.7.kext" # Hack to use 10.7 kext in 10.8
        ;;
esac

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

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

exit 0
Leask Huang
Leask commented July 12, 2012
Coby Chapple

Thanks @joshskidmoreadding those three lines worked a treat!

(Running 10.8 GM Seed)

Darren Cauthon

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

agileadam

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 kext.sh
vim kext.sh (edited the file)
sudo chown root:wheel kext.sh

Thanks! Vim-sanity is restored!

HIRANO Satoshi

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!!

hirano

Johnlin

@joshskidmore It works like a charm.

Chris George

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

drsethl

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

Travis Northcutt

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

vishvananda

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

drsethl

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.

Travis Northcutt

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.

AJ ONeal

https://gist.github.com/3204240

PC Keyboard Hack on OS X 10.8 Mountain Lion

TL;DR

sudo curl \
    -L https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh \
    -o /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

Instructions

  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/kext.sh
    
  4. For safety's sake, inspect the updated kext loader https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh

  5. Copy the updated kext loader over the original

    sudo curl \
        -L https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh \
        -o /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh
    
  6. Now verify that the file is what you expect:

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

drsethl

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

AJ ONeal

@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?

vishvananda

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

Ben Yafai

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

Chris Maddox
tyre commented August 02, 2012

This is amazing. Thank you so much!

ekoger

Worked perfectly. Thank you!

James Kirkus-Lamont

@coolaj86 Nice one thank you!

The source code for 10.8 has been published: http://www.opensource.apple.com/release/mac-os-x-108/

Takayama Fumihiko tekezo closed this August 11, 2012
Takayama Fumihiko
Owner

I've released PCKeyboardHack for OS X 10.8.
http://pqrs.org/macosx/keyremap4macbook/pckeyboardhack.html.en

David Maciejewski
macx commented August 11, 2012

Thank you tekezo for your support!

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

Arthur Maltson

Thank you tekezo! Caps Lock = Esc again :)

grillermo

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.
Edit:
It was microsoft's software to control the keyboard messing with pckeyboardhack. I uninstalled it and the problem is solved.

Leask Huang
Takayama Fumihiko
Owner

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
Something went wrong with that request. Please try again.