More work on linux iohub 2 keyboard events.

- improved shift / caps lock mod state detection
- consolodated keyboard logic within pyXHook