In java you normally capture key events by adding a key listener to a javacomponent. That would exclude all the stuff which other system windowswould be capturing.