Added support for low-level mouse and keyboard hooks.
Misc keyboard handling cleanups.

16 files changed