Install an event filter and check there for key events.