How to listen to key press?

I am creating a drawing module and want to listen to SHIFT keypress to draw 0/90/45 degree lines. I tried using KeyListener and KeyAdapter but later learned that they only work when components with text input are in focus. Can anyone provide me with a link / tutorial on this?
[283 byte] By [coolprosua] at [2007-11-27 5:34:50]
# 1
[url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]How to Use Key Bindings[/url]
camickra at 2007-7-12 15:03:11 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks
coolprosua at 2007-7-12 15:03:11 > top of Java-index,Desktop,Core GUI APIs...