This behavior might have caused by the GWT internals spoiling some button codes for us (this is the case for Vaadin 8).
This needs further investigation, have created a ticket for it: https://github.com/vaadin/flow/issues/4351
Feel free to subscribe for it to get the results.
Posting some details here as well:
This is how JS works.
Key press event is not always fired for any keys. JS doesn’t allow handle key press events for ESC and other special keys via event handler.
But you may add a listener for key down and key up events which always works.
So please use addKeyDownListener/addKeyUpListener methods instead.