Detect if Enter key pressend in text field

Is there a way to detect if the enter key was pressed in a text field? Just need this until key pressed if added so that i can automatically run a method when the enter key is pressed. Was thinking something like Instr(TextField1.Value.Length-1, TextField1.Value, ASC(??))

Thanks for helping!

In 2020R1 this is not possible, have you thought about using the lost focus event?

The Default button responds to the Enter key. Put your code there.

1 Like

In this situation I dont want the field to lose focus. I did consider that and thanks for the suggestion.

I will try this and see what happens. Thanks!

you could use Xojo 2019 until a future version of Xojo 2020 may have more events.

1 Like

Tim Parnell solved the issue for release 2020r1.2.

1 Like