top | item 12623866

Karabiner – Easy Keyboard Remapping for OS X

179 points| fspacef | 9 years ago |github.com

101 comments

order
[+] JohnGB|9 years ago|reply
Karabiner (and its predecessor) is invaluable for me every day use of my macbook. In general using a touchpad feels like trying to type with only one finger, but with the "multi-touch exension" (I think it's based on touchsense), allows me to redefine my keyboard depending on what's happening on my touchpad.

So, now my left hand is always on the home keys, and if I'm touching the touchpad with one finger, the home keys are my left, right, and middle mouse buttons. If I'm touching it with two fingers, the home keys and nearby keys remap to save, refresh, find, select all, copy, paste, cut, close, and others. If three fingers are touching, then my keys remap to my windows layout and other utility programs which I often call (such as the terminal).

There are many other general remappings which have made my life at a keyboard much faster and easier to use, but the multi-touch extensions are the ones that I would struggle to live without.

As a side note, if you use the product and find it helpful, you should really consider donating to it. It will make you feel like a better human, and encourage continued support.

[+] lucidstack|9 years ago|reply
The multi-touch extension sounds amazing. I went to try it, but it doesn't seem to work. I see the little dialog in the bottom right corner when I have my fingers on the trackpad, but nothing happens on keystroke.

It's mostly definitely due to the recent update to Sierra. If you do use Sierra, have you managed to make it work?

[+] lars512|9 years ago|reply
I used Karabiner for a month after getting hit by a car and breaking my right wrist. I couldn't use that hand at all whilst it healed.

I had Karabiner remap my keyboard to half-qwerty, so that I could type entirely using my left hand on the left side of the keyboard only. A modifier key would switch it into "mirror mode" so that all the left-side keys would be remapped to right-side keys. Fun stuff!

[+] milesokeefe|9 years ago|reply
Once you regained use of your right hand did it take any time to get back to full typing speed using both hands?

How close to your two hand WPM did you achieve with your left hand alone?

[+] eyelidlessness|9 years ago|reply
I had a bike accident which prevented me from typing with my left hand for a couple weeks (dislocated shoulder, broken finger). I wish this were around at the time! I had looked into physical half-qwerty keyboards, but I couldn't afford one.

I ended up hobbling together a simple app that switched two full system key layouts while holding the spacebar, more or less mimicking the half-qwerty behavior. It was my first Mac app, and it was pretty crashy, but it kept me working for those couple weeks.

I wanted to open source it, but ceased work when I was able to type with both hands again, because I knew half-qwerty was patented and didn't want to take that risk.

Really glad there's an easier solution now!

[+] tomcam|9 years ago|reply
Just had to put left arm in a brace and would like to hear results too.
[+] neurocroc|9 years ago|reply
This application has been really huge for my productivity.

I have literally rebinded every single key on my mac with it. It is very powerful especially when you combine it with the multitude of Alfred workflows and different scripts that you can run.

I open Alfred with just single press of right command, I switch between all my apps through hotkeys, my caps lock is a hyper key, my right shift is delete. Can't give more praise to this tool really.

Here is how I use it and what my config file for it looks like for all interested :

https://github.com/nikitavoloboev/dotfiles/tree/master/karab...

More importantly, it allows to keep myself sane with the enormous amounts of apps and tools I run on my system (https://github.com/nikitavoloboev/my-mac-os) and interchange with them seamlessly.

[+] Singletoned|9 years ago|reply
With all that software, I don't suppose you've come up with a good solution for installing and configuring it all automatically on a new machine?

Last time I tried to automate it I used homebrew cask, but it definitely wasn't a satisfying solution.

[+] mrkgnao|9 years ago|reply
I don't know, it seems like you've implemented some kind of macOS-wide Spacemacs :)
[+] fspacef|9 years ago|reply
Nice guide, was planning to do something like that myself.
[+] konart|9 years ago|reply
https://github.com/tekezo/Karabiner/issues/660

You should probably consider reading this if you are on 10.12 or planning to upgrade

[+] dopu|9 years ago|reply
Seconding this. I'm now unable to use CAPS LOCK on my Mac as ESC, which makes using vim slightly more of a pain.
[+] torspo|9 years ago|reply
Since upgrading to Sierra broke my Karabiner, I started using Ukelele. http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=...

I tried Karabiner Elements but couldn't figure out how to replicate my configuration.

[+] quinndupont|9 years ago|reply
Anyone have any comments on limitations/issues with Ukelele? I'm stranded with Karabiner-Elements being so rough, and I'd like to switch to something simpler (I just need to remap option and command keys for my external keyboard)
[+] Stratoscope|9 years ago|reply
Karabiner is great. After XtraFinder stoped working because I upgraded to El Capitan and didn't want to disable SIP, I tried Karabiner to see if it had the one feature from XtraFinder that was essential for me: changing the crazy Finder key mappings of Enter to rename a file/directory and ⌘O to open it.

I like having Enter open a file or directory and F2 rename it, and not just because I'm used to Windows. I open things a lot more than I rename them. Enter is the canonical key for opening something, and does just that in OSX file dialogs. It makes no sense that Enter does one thing in file dialogs but something completely different in Finder.

Sure enough, right there in Karabiner's built-in settings were options to remap those keys.

[+] ensmotko|9 years ago|reply
Remapping the caps lock key to the delete key (delete the character in front of the cursor) has been a great productivity boost for me. Below is the karabiner.json file that I'm using for this:

{ "profiles": [ { "name": "Default profile", "selected": true, "simple_modifications": { "caps_lock": "delete_forward" } } ] }

[+] copperx|9 years ago|reply
Interesting. Remapping it to Control is the greatest help for me because most Mac programs support basic Emacs keybindings. Using Ctrl a or e to go to the end of line is much easier than pressing Fn.
[+] xrjn|9 years ago|reply
Karabiner is quite cool but there were a few gotchas that were non intuitive for me. I wrote a getting started guide[0] a few months ago that starts right from the beginning.

[0] https://medium.com/@.sasha/hacking-apple-s-consumerist-cultu...

[+] grantcox|9 years ago|reply
This was very helpful for me, thank you.

I couldn't get Karabiner to work - it seemed to install correctly, but none of the "prepared settings" did anything. No matter what options I'd chosen, my keyboard (both laptop keyboard and external) were unaffected.

Reading over your guide I decided to just try your "swap space and tab" example in the private.xml file, and lo-and-behold, that worked. As does recreating the inbuilt "play/pause, mute and volume to F9-F12" in private.xml, whereas the inbuilt version doesn't work for me.

[+] rbalicki|9 years ago|reply
Absolutely love this tool (and Seil, and BetterTouchTool). I shift-reversed the number keys (i.e. shift-6 prints a 6, the 6 by itself prints ^), made my left and right shift's open and close parentheses (I tried to make alt+left-shift a square bracket, but couldn't get that working very well), made caps lock escape or control and shift-reversed the backslash/pipe key.

I have trouble using other people's keyboards now but I'm very productive on my own!

[+] mrkgnao|9 years ago|reply
I have a pretty wacky config (xorg for me), but I'd never thought about shift-reversing. This is brilliant; I'm grateful for the tip!
[+] dm03514|9 years ago|reply
karabiner is absolutely critical to support external input devices, such as footswitches.

OSX does not allow usb devices to modify input from other devices:

Note: Modifier actions from one USB device cannot modify the input of a second USB device due to limitations designed into the Apple operating system. Example: Shift, Control, Command, or Option keystrokes programmed into the footswitch cannot modify the input of a separate USB keyboard or mouse. However, a key sequence like ‘Cmd-W’ or ‘Cmd-Shift-left arrow’ will work on a Macintosh if the entire sequence of keystrokes has been pre-programmed into the footswitch. (Footswitch can only be programmed on a Windows PC).

http://apple.stackexchange.com/q/140732/8592

While Karabiner supports this:

Share state of modifier keys with all connected keyboards: When you are using multiple keyboards, modifier keys are shared with all keyboards. For example, pressing "shift key on keyboard1" and "space key on keyboard2" sends shift-space.

[+] psyc|9 years ago|reply
All I hear about lately is how great this app is. I have two use cases that are pretty important to me, and for the life of me I can't figure out how to make them work.

I want to remap an ordinary letter key to another ordinary letter key. This app loves special keys to death, but I can't figure out how to do anything with boring keys.

I also want to disable the built-in keyboard while I'm using a bluetooth keyboard. Apparently you could maybe do this before Sierra, but not with the Sierra prototype? I don't know. This is the kind of byzantine app where it's next to impossible to know whether you're missing something among its piles of features.

[+] guptaneil|9 years ago|reply
FWIW, the Sierra prototype is missing 95% of the features of the full pre-Sierra app. It's merely a proof of concept of the architecture rewrite needed to support Sierra.
[+] kps|9 years ago|reply

  > I want to remap an ordinary letter key to another ordinary letter key.
Regular keys should probably be mapped with a regular keyboard layout, unless 10.12 screwed that up too. See Ukelele (sic) http://www.sil.org/resources/software_fonts/ukelele or just copy and edit a .keylayout file.
[+] transfire|9 years ago|reply
Honestly, someone needs to go back and rethink the way keyboard input is handled in Unixes. There are a lot of neat ideas out there that just can't be done without a programmable keyboard controller.
[+] mherdeg|9 years ago|reply
I use this tool because I like to run the binary distribution of nethack from the command line inside an OS X Terminal window, and I am VERY accustomed to using the up/down/left/right arrow keys to move around (from how things used to work when I ran Windows). It seemed really hard to send that binary "hjkl" instead of up/down/left/rgiht arrow key signals any other way and it also seemed hard to compile in the desired behavior by hand (although, hmm).

I'm lazy, so I ended up just running Karabiner with this tiny private.xml: https://gist.github.com/mherdeg/4eca69637d176bc81ea19207b911...

I found that I context-switched between places where I wanted the arrow key to send hjkl (Terminal.app running the binary) and places where I did not (everywhere else). To make things slightly easier, I set up a "profile" in Terminal.app called "nethack" which uses xterm-16color, displays ANSI colors in a readable way, sets the window title to "Nethack", and launches /usr/local/bin/nethack when this profile is opened. The Karabiner private.xml setting that can be toggled on/off here ends up pretty much only rewriting arrow keys when I want them to.

This seems like kind of a crazy workaround but it was really easy to deploy.

[+] kardashian007|9 years ago|reply
Karabiner doesn't work at all with Sierra. There's some "new" project called Karabiner Elements is supposedly half-finished, but yet people keep donating hoping they'll get something usable soon. Not holding my breath and it would be completely new and will likely lack useful features of the abandoned one.

It would be more useful to more people to temporarily fix Karabiner and work on Elements later, but no, gotta ignore paying users and stick to "the plan."

[+] meta_AU|9 years ago|reply
Would go crazy without this. My work Mac has fn as the far left key, now I have it mapped to Ctrl for most combinations but it is clever enough to know that fn + down is pgdown.
[+] ZhangBanger|9 years ago|reply
Having lots of issues with Karabiner Elements on Sierra. Are all the mapping options available? I looked into the source and I see no way to replicate my Karabiner mapping - no mouse key mapping, function keys no longer work as F1-F12 keys, no 'eject' key (a shortcut for locking your screen, since OSX doesn't handle this well by default).
[+] izacus|9 years ago|reply
It's a great piece of software. I maintain a few Macs for my family and they don't use Apple keyboards for various reasons. Since Apple refuses to add support for standard PC layouts (and creates monstrosities like localized keyboard layout which has @ key on shift + alt + 2 which causes no end of support requests), having Karabiner remap it to the standard PC keyboard layout matching the hardware is a huge boon.
[+] Someone|9 years ago|reply
System Preferences => Change Keyboard Type… gives an UI that directs you to press a few keys that help detect your keyboard layout. That has worked fine for me (N=1) when adding a Dell keyboard to a Mac Mini.

I think that UI was added for the Mac Mini, as it was the first Mac sold without keyboard ("bring your own keyboard and mouse")

[+] oneeyedpigeon|9 years ago|reply
From [0]:

> Do not change the location of Karabiner.app from /Applications.

> For example, Karabiner will not work properly if you moved Karabiner.app into /Applications/Utils.

I'm curious: why is this?

[0] https://pqrs.org/osx/karabiner/