Wednesday, January 4, 2017

Avoiding "Emacs Pinky"

My recent switch to using Apple Macintosh has had a surprising painful side effect sometimes called "Emacs Pinky".  Emacs Pinky is wrist pain associated with using the Emacs editor all day, or in my case any other editor which uses the Control key a lot.  I have never experienced this problem before, but it seems that the Apple aluminum keyboard which I recently began using is part of the problem.

Apple's aluminum keyboard design does look very cool.  It is very sturdy looking, and the keys feel nice.  However, compare it to ergonomic keyboards which have been designed to avoid RSI (Repetitive Stress Injury).

  • Ergo keyboards are curved whereas Apple's keyboard is straight
  • Ergo keyboards are elevated whereas Apple's is relatively low and flat
  • Ergo keyboards have an attached palm rest to keep your wrists from bending, Apple's keyboard does not
I do not believe that Apple makes an ergonomic keyboard.  I did see some third party ergo keyboards online that are designed for Apple, but most were pretty expensive.  So, I headed down to the local Best Buy store to see what they have.  I noticed that Microsoft's Wireless Comfort 5050 with mouse was on sale, and reading the back of the box it said it works with Mac OS X.  Sold.

There is one minor gotcha with the Microsoft keyboard.  It is, naturally, designed primarily for Windows and therefore has Alt and Windows keys instead of option and command keys, but this is less of a problem than it sounds like.  It turns out that the Alt key is really the same as Apple's command key, and the Windows key is really the same as Apple's option key.  Unfortunately, their position is swapped.  However, in MacOS it is quite easy to go into System Preferences->Keyboard->Modifier Keys, select the Microsoft keyboard (once it's been attached) and swap the function of the Option and Command keys.  Problem solved.

Testing out the Microsoft keyboard, it seems to work fine, although it has a lot more buttons than on an Apple keyboard and I haven't taken the time to try them all out.  The volume buttons work as expected, and so does the pause/play, previous and next buttons (tested in the Spotify app).  The PrtScn button doesn't do anything, but Mac users should be used to not having a PrtScn button.  (Actually, since PrtScn is just F13, it is possible to map a keyboard shortcut to use this, but the Macbook's internal keyboard has no F13 so it won't work when the external keyboard is not attached.)  Interesting, I discovered Microsoft actually has a support page describing Keyboard mappings using a PC keyboard on a Macintosh.

The one other thing I have run into so far that I don't like about the Microsoft Comfort 5050 keyboard is the Esc key and function keys are very small, and as a Vim editor user I use the Esc key a lot.  Note that the newest MacBook Pro actually eliminated the esc key, and one of the suggested solutions to bring it back for Vim users is to remap the option key to act as Escape.  I could try something similar with the Windows keyboard, but it might mess with my muscle memory which tells me the Esc key is "supposed to be" in a certain place.

By the way, the Wireless Comfort 5050 also came with a mouse which works quite well.  I wanted a keyboard that came with a matching mouse so that I would still need just the one USB port.  Unfortunately, Microsoft does not provide a Mac driver for the mouse, so MacOS treats it rather generically and it isn't as customizable as an Apple moue or a Logitech mouse made for Mac with Logitech's driver.  However, you can download a third party shareware driver called USB Overdrive which will allow you to customize settings of virtually any mouse.

Of course, there are probably other things I could do to reduce my risk of RSI, but this was a quick fix for a very specific problem.  Other suggestions for avoiding "Emacs Pinky" include:
  • remapping the Caps Lock key to be be another Control key
    • not sure how to do that on Mac or if it is even a good idea as it might cause other problems
  • pressing the Control key with your palm or knuckle
    • palm seems super awkward for me... knuckle might work
  • using Vim (or Vim IDE plugin) instead of Emacs
    • I already use a Vim IDE plugin, and don't use Emacs
  • using both hands for control key combinations
    • I must admit that I'm in the habit of using the left control or command keys for copy and paste, which is possibly part of my problem, but some keyboards, including the Macbook's internal keyboard, do not have a a control key on the right side.  You could potentially swap the option and control keys, but that might cause other issues.
(See How to Avoid the Emacs Pinky Problem for more information and ideas.)

So far after switching to the ergonomic keyboard I am not experiencing the "Emacs Pinky" pain.  I'll update this blog later once I've decided if this is a long-term success.