dual keyboards for os x

problem

When using multiple keyboards in OS X, modifier keys (shift, command, option, control) on one keyboard do not affect keys pressed on other keybeards. So typing "shift" on one keyboard and a "t" on the other would result in a lowercase "t" rather than an uppercase one.

solution

Compile this code on a Mac and then run it in the command line, probably as Super User.