Dear Thiago:

I don’t think it’s related to undo but to a TextField with a formatter.

The question is - do you want to disable the standard behavior (updating the 
text using the formatter on ESCAPE) completely?  Or perhaps you do want to let 
TextField invoke cancelEdit() (see TextInputControlBehavior:178) and then close 
the stage?

In the latter case you might consider adding an event filter on the Stage and 
calling hide() from there in a Platform.runLater()

What do you think?

-andy


From: openjfx-dev <openjfx-dev-r...@openjdk.org> on behalf of Thiago Milczarek 
Sayão <thiago.sa...@gmail.com>
Date: Tuesday, November 21, 2023 at 02:37
To: openjfx-dev <openjfx-dev@openjdk.org>
Subject: ESC key binding on the Scene
Hi,

I would like to use ESC to close Stages. The problem is that if the focus is on 
a TextField, it consumes the event.

ESC is the key binding to Undo on the TextField, but it's always consumed, even 
if there's nothing to undo.

Is this correct? Should it not propagate if there's nothing to undo?

-- Thiago.

Reply via email to