Add ctrl key support for keyboard handler.

Originally written by @wikenator.