Using the DOM directly you'd add an event listener to the document (there are several ways to do this).
But looking at the GWT API I don't see a way to do this. I've looked at Window and Document and neither seem to have anything about adding key handlers. In order do this you need to use something with a HasKeyPressHandler. But this only works on certain elements, and more importantly, it only works when the element is focused and I'd like to capture all key events instead.
Is there a way to do this in GWT?