• You are not logged in.
  • Index
  • Technical
  • Advanced OSX keylayout / keyboard driver hackery

    Advanced OSX keylayout / keyboard driver hackery

    • Started by Sigmoid
    • 8 Replies:
    • Reputation: 0
    • Registered: 22-Apr-2015
    • Posts: 16

    Hey,

    I wonder if there is anyone around who has taken the time to dig into the deep internals of the OSX character layout system... Most people seem to stick to Ukelele, which I don't have a very high opinion of, and it generally bothers me how closed OSX is about the keyboard layouts.

    Has anyone managed to get into the heart of the OSX keyboard layout system? Extract the system layouts from the bundle file and read them? Add a new "system" layout, or do something like an equivalent to registry remapping? Do something at a driver level - when you plug in a keyboard, OSX asks you to press certain keys to identify it - is it possible to add a new "kind" of keyboard to that selection?

    Offline
    • 0
    • Reputation: 0
    • Registered: 17-Nov-2014
    • Posts: 102

    Great question. I would be interested, but that is way above my level.

    Offline
    • 0
    • Reputation: 0
    • Registered: 22-Apr-2015
    • Posts: 16

    Hm... I wonder why there are so few people hacking OSX... It's half open source, and one of the most popular OSes around...

    Anyway, here's what I've found so far.

    https://developer.apple.com/library/mac … _uchr.html - A description of the binary keyboard layout format...

    http://www.snark.de/mac/usbkbpatch/index_en.html - Then there's this thing, which is a driver level remapper, only it's really bloody old. However, even the latest OSX has the same mapping table, see https://opensource.apple.com/source/IOH … _USB2ADB.c...
    So it could be actualized for Yosemite.

    Offline
    • 0
    • Reputation: 0
    • Registered: 22-Apr-2015
    • Posts: 16

    I have recently found a pretty interesting article from a Black Hat conference about hacking the Apple keyboard firmware, even though it's not quite recent...
    https://www.blackhat.com/presentations/ … -PAPER.pdf

    Especially for a layout that moves around the home positions, it would be nice to have a reprogrammable keyboard... :) Eg. turn the MBP keyboard into a "wide QWERTY" in firmware, and then just apply the regular Colemak layout. :)

    Offline
    • 0
    • Reputation: 7
    • Registered: 21-Apr-2010
    • Posts: 818

    Any use?:

    http://hints.macworld.com/article.php?s … 8131542947

    If not I'll delete the link.

    --
    Physicians deafen our ears with the Honorificabilitudinitatibus of their heavenly Panacaea, their sovereign Guiacum.

    Offline
    • 0
    • Reputation: 0
    • Registered: 22-Apr-2015
    • Posts: 16
    pinkyache said:

    If not I'll delete the link.

    Why would you do that? Thanks for the post, it's interesting. :)

    Offline
    • 0
    • Reputation: 0
    • From: Poland
    • Registered: 28-Jun-2015
    • Posts: 7

    On OS X, I use Karabiner, it's very flexible: https://pqrs.org/osx/karabiner/

    I'm guessing there's not much low-level work on OS X because Apple likes to change low-level interfaces a lot, and things work quite well out of the box...

    Offline
    • 0
    • Reputation: 0
    • Registered: 19-Jun-2015
    • Posts: 10

    Vouch for Karabiner. Very powerful application.

    Offline
    • 0
    • Reputation: 210
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,343

    Mkborregaard has used Karabiner extensively to provide much of the Big Bag Of Tricks for Mac; maybe you'll find some useful Karabiner tricks too there?

    Last edited by DreymaR (02-Jul-2015 09:33:39)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
      • Index
      • Technical
      • Advanced OSX keylayout / keyboard driver hackery