Detect the Enter Key Pressed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect the Enter Key Pressed

Matias Maretto
Hi: I 'm trying to detect when the user press the enter key on a
TextEdit.
In the #createSchematicWiring, I put code to detect the triggers
#keyPressed: and #keyTyped: . This works fine for all the keys except
the Enter !  I don't know why, but this trigger really detects all key
I press on my keyboard except the Enter. Does anyone know why?.

Thanks !.


Reply | Threaded
Open this post in threaded view
|

Re: Detect the Enter Key Pressed

Sebastián Sastre
Try hooking #actionPerformed for that TextPresenter like this:

  thatTextPresenter
     when:#actionPerformed send: #onThatTextPresenterActionPerformed
to: sef;
    yourself.

regards,

Sebastian



Matias Maretto escreveu:

> Hi: I 'm trying to detect when the user press the enter key on a
> TextEdit.
> In the #createSchematicWiring, I put code to detect the triggers
> #keyPressed: and #keyTyped: . This works fine for all the keys except
> the Enter !  I don't know why, but this trigger really detects all key
> I press on my keyboard except the Enter. Does anyone know why?.
>
> Thanks !.


Reply | Threaded
Open this post in threaded view
|

Re: Detect the Enter Key Pressed

Matias Maretto
Sebastián: Thanks. But I have found the problem. I don't know why, but
the problem is the presenter. Every enter key I press on a Control in a
Presenter doesn't trigger a KeyPressed event. I just mutate my
presenter into a Shell view and now it works.

Regards.


Sebastián wrote:

> Try hooking #actionPerformed for that TextPresenter like this:
>
>   thatTextPresenter
>      when:#actionPerformed send: #onThatTextPresenterActionPerformed
> to: sef;
>     yourself.
>
> regards,
>
> Sebastian
>
>
>
> Matias Maretto escreveu:
>
> > Hi: I 'm trying to detect when the user press the enter key on a
> > TextEdit.
> > In the #createSchematicWiring, I put code to detect the triggers
> > #keyPressed: and #keyTyped: . This works fine for all the keys except
> > the Enter !  I don't know why, but this trigger really detects all key
> > I press on my keyboard except the Enter. Does anyone know why?.
> >
> > Thanks !.