Spurious button click sent when pressing escape in ComboBox

How to reproduce: in WidgetsDemo.h, MiscPage, add a

TextButton button;

and initialise it in the MiscPage() constructor:

button.addShortcut(KeyPress{KeyPress::returnKey});
button.onClick = [this]() { textEditor1.setText("THIS IS UNEXPECTED"); };
addAndMakeVisible(button);

Then lanch DemoRunner. In that demo, click in the combo box, so that its text is selected in edit mode. Press ‘Enter’, the ComboBox has the focus, press ‘Enter’ again, the combo box is now showing its PopupMenu. Press ‘Escape’ to exit the menu, and the button ‘onClick’ method is called.

I think this is caused by the way Button keyboard shortcuts are handled. It incorrectly assumes that the Return key has been released, when the escape key is released…

(test performed on macos, with latest develop).