How to ignore ESC-key default behavior?

I noticed one problem when I accidentally hit ESC-key while there was progress indicator running because of a time consuming process being executed. ESC-key interrupted the process and after that I got some communication exceptions. I noticed that ESC-key doesn’t have any effect in Opera but in iExplorer and Firefox the problem occurs. Is there some way to ignore ESC-key in my Vaadin-app or should I try to register action for ESC-key so that my processing thread is interrupted gently?

Since this is a known problem that hitting ESC will cancel active XHR-request in Firefox and IE and there isn’t a way to prevent this from happening in any reasonable way in my Vaadin app, I’ve come up with a workaround that seems to be working fairly well. I’ve created my own Window-class which is registering the ESC-key shortcut to do nothing and extend this custom window everywhere in my app. I know this is ugly but I had to do something and couldn’t find any reasonable solution to this.

That’s exactly what I would’ve suggested that you use as a workaround. Basically from JavaScript POV you need to call event.preventDefault()/stopPropagation() when the esc key is pressed.