“Palm rejection” is the name for a cool technological trick which comes in very handy if you like drawing or writing on your fancy capacitive touch tablet. It allows your drawing application to distinguish between touches made by your hand and by the pen.

In pen and paper writing (and drawing), you’d rest your hand on the paper for maximum stability. Thing is, you can’t do that with a tablet, because the tablet would register the palm of your hand as a “touch” and start drawing lines at that point.

Some devices try to allow you resting your palm on them by detecting the “area” of the touch, and if the area is large, the touch is not by a finger and will not be registered. Unfortunately, this solution is not very accurate.

Photoshop Elements has a cute option for you to put a virtual “palm rest” on the device, and The application will ignore touches in that area. But this requires users to keep track of the virtual palm rest, and move it around when they want to reposition their hand.

Enter the Bluetooth pen

There’s a new game in town, though. A variety of modern styluses with Bluetooth capabilities enable actual, accurate palm rejection.

I was wondering how this technology works, but could not find a website where the mechanisms are actually described. So, in a reflex that’s served me well many times already (and which I encourage everyone to adopt), if I want to figure out how something works, I ask myself:

How would I design it?

Designing palm rejection

Obviously, there is communication going on between the pen and the tablet to allow the tablet to know where the pen is on its surface.

  • The most straightforward thing to do, which might be your first guess, would be for the pen to send its location to the tablet, in the way traditional drawing tablets work. However, this brings up the problem of how the pen would know its location on the tablet. To find out, either:
    • The tablet must be designed specifically for the pen by containing some sort of electromagnetic beacon which allows the pen to locate its position. It’s likely not very cost-efficient to design tablet hardware that way; or
    • The pen would need a camera, and the application on the tablet would need to display some sort of pattern that would allow the pen to locate itself (like this awesome digitizing pen that works on paper).
  • Okay, so the pen transmitting its position is not a very likely candidate for a succesful design. Could the tablet maybe determine the position of the pen from information it has available? Like use the front facing camera to see if the pen is near a location where touches are deteced? This also seems a very brittle solution, so probably not.
  • However, what if instead of thinking of the pen’s SPACE, we thought of its TIME? We know when a new touch is detected on the tablet. Now, if the pen sent us a notification whenever its tip was pressed, we could intersect those datasets and ignore all touches that didn’t coincide with a press of the pen (and keep ignoring that same touch for as long as it was on the tablet).

Ultimately, the last design seems very simple, robust and cheap to implement, and I’m fairly sure this is how palm rejection actually works. However, this is still just guesswork, considering I don’t even own such a pen ;). It should be easily verifiable though. And I would be obliged if someone could point me to some more authoritative information.

I’m putting this page up as a reference to future searchers, and to show how a simple mental exercise can give you insight into some black box system. This kind of thinking reflex can be applied to anything in computer science, be it a library, a piece of middleware or an external system you’re interfacing with, and will serve you well if you need to understand something.