Hi Kasper

 

Problem solved.�� I���ve done some more experimenting and it seems that registerEvents needs to be sent to make ��whenTextChangedDo: active.�� Makes sense but haven���t seen it documented anywhere.

 

Regards

Robert

 

From: Kasper Osterbye <kasper.osterbye@gmail.com>
Reply to: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Date: Saturday, 12 March 2022 at 10:31
To: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Subject: [Pharo-users] Re: Detecting keystrokes in Spec2 input fields

 

If it is in the TextPresenter you might be looking for 

whenTextChangedDo: or whenSubmitDo:

Both inherited from SpAbstractTextPresenter

 

Best,

 

Kasper



On 12 Mar 2022, at 11.26, Robert Briggs via Pharo-users <pharo-users@lists.pharo.org> wrote:

 

Hi

 

Is there a simple way to detect when a use makes a keystroke in for example a Spec 2 Text Input Presenter?

 

I���ve been going through all the relevant classes and methods, even into Morphic, but so far I have not found a way to do it.

 

I want to be able to identify when unaccepted changes have been made to the displayed text to ensure that a use does not leave a form without saving any input made.

 

Regards

Robert