Text Field Text Area and Enter Key

Perhaps this will help someone.

Been working on a little iPad kiosk-like app. After some preliminaries we collect the user’s first name, last name, and email. I’ve been holding the iPad (I am the kiosk) and watching. Users kept tapping the Done key (which is what shows up on the keyboard with an iosTextField) to go to the next field.

Now, it’s not possible (as far as I know) to detect a tap of the Enter/Done/Return key from a text field. It is, however, possible to detect it from a iosTextArea.

So, I put some code in the TextChange event to see if the user tapped Return. The problem is that by the time TextChange has happened, the Return key has already been sent to the text area, and it scrolls up a line. Even if one then replaces the text (without the return) the line is still scrolled. I would think this is a bug somewhere.

After mucking around a bit, I tried the SelChange event. Works like a charm.
Here’s what I have in SelChange. The event raised is so the field being shown can do what it needs to. In my case, it moves to the next field.

Dim value As Text

value = Self.Text
If value.endsWith(&u0A) Then
value = value.TrimRight
Self.Text = value
RaiseEvent EnterKey