mmm... ESC is already used to exit from a chat window. I'm not sure making a single key do more than one thing is necessarily a good idea. Since there is already a "deselect target" (actually "target nothing") action, I suspect you can assign it to ESC, but I don't know what that would do to the chat-window functionality.
---
Remembering Tyneetryk
Phaedreas Tears - 15 years old and first(*) of true neutral guilds in Atys.
(*) This statement is contested, but we are certainly the longest lasting.
<clowns | me & you | jokers>