Why does onAction fire on keyPressed and not on keyReleased?

We noticed that the onAction of a button fires on the keyPressed event of an enter (or space) when that button has the focus.

We have a form in dialog with an ok button. The onAction of this button causes the form in dialog to close. When an enter is pressed the form in dialog closes, but when we have not released the enter quick enough the form in dialog already has been closed and the keyReleased of the enter is sent to the underlying form. Which in our case is a form in find-mode, so the keyReleased-event causes the search event of the underlying form to fire :(

This could easily be solved when the onAction of a button is fired on the keyReleased in stead of the keyPressed event of an enter (or space or also mnemonic).

Hi Michel

I would like to take your post to reiterate a long standing wish to get some diagrams or descriptions showing the event model with it’s depndences in various situations implemented in Servoy. Birgit and I discussed it with Jan Blok at the 2nd ServoyWorld where we already tried to figure out how some event sequences work. Jan, any chance for such a description?

Best regards, Robert