Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Doesn't work in Mountain Lion? #8

Closed
Leask opened this Issue · 41 comments
@Leask

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

@tekezo
Owner
@Leask
@macx

Still no updates?

@johnmcdonnell

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

@mrfoto

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

@peppy

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

@olfway

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

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

@shemerey

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

@Leask
@felixbuenemann

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.

@joshskidmore

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

Thanks @joshskidmoreadding those three lines worked a treat!

(Running 10.8 GM Seed)

@darrencauthon

@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

@johnlinvc

@joshskidmore It works like a charm.

@chrisgeo

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.

@tnorthcutt

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

@tnorthcutt

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.

@coolaj86

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!

@coolaj86

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

@benyafai

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

@tyre

This is amazing. Thank you so much!

@ekoger

Worked perfectly. Thank you!

@jimmykl

@coolaj86 Nice one thank you!

@mindloaf

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

@tekezo
Owner

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

@tekezo tekezo closed this
@macx

Thank you tekezo for your support!

@mindloaf

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

@amaltson

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
@tekezo
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.