how to move cursor to end of text in text box?

304 views
Skip to first unread message

Arun Mehta

unread,
Oct 28, 2015, 7:21:48 AM10/28/15
to MIT App Inventor Forum
Hi, At my NGO (bapsi.org), we are writing software to allow persons who are deaf with low vision to use smart phones. One problem is the cursor in text boxes. When handling the device, it  can inadvertently get touched on the screen, changing the cursor position.

Is there some way to automatically reposition the cursor, specifically at the end of the entered text in the text box?

warmly,
Arun

Abraham Getzler

unread,
Oct 28, 2015, 11:58:09 AM10/28/15
to MIT App Inventor Forum
I don't see how to do that, but I can imagine a little bit of misdirection
to simulate that effect.

What if the text box were preceded by a label with automatic width,
and the leading characters of the text box input were continually stripped off
by a fast clock and appended to the end of the label?
Have the label set to right-justified and the text input box to left justified,
to make the input appear contiguous.

ABG

Arun Mehta

unread,
Oct 30, 2015, 9:07:45 AM10/30/15
to MIT App Inventor Forum
thanks, Abraham, I appreciate the tip, was hoping for a less complicated solution. The problem with what you suggest, is the handling of the backspace key. If the backspace is pressed when the text box is empty, there is no way to sense it -- or do you know of one?
warmly,
Arun

Italo

unread,
Oct 30, 2015, 9:53:28 AM10/30/15
to MIT App Inventor Forum
I know you are looking for an easy solution, but you may consider creating your own keyboard then, with buttons. It's easier than it sounds and you can control everything the user does with it.

Abraham Getzler

unread,
Oct 30, 2015, 1:23:58 PM10/30/15
to MIT App Inventor Forum
Along the lines of @Italo's suggestion, try MessagEase, one of the better free full screen
overlaid keyboards:

It is intended for single finger use on small screens.

Regarding the backspace problem, I tried writing a sample app for  this,
but found I had to keep at least one character in my text box, reclaiming the last
letter from my label to the text box if I ever deleted my last letter.

Also, the cursor in my text box kept jumping to position 0 each time I messed with the
text contents of it, forcing me to jump through hoops to figure out which letter to
transfer and making the backspace key ineffective.

So my idea didn't work.

ABG

Arun Mehta

unread,
Oct 31, 2015, 1:14:04 AM10/31/15
to MIT App Inventor Forum
Thanks, @Italo and Abraham, for the excellent suggestions, and the effort put into helping me find a solution. 

The solution I have so far attempted to the backspace problem, Abraham, is to request the user to not use it! Instead I am providing a small red canvas on the screen. Depending on how you drag your finger across it, you delete a character, a word, or to the last punctuation (I do also provide an Undo feature :)

While I will try MessagEase myself, my suggestion to a low-vision person is to use a hard keyboard. There is no replacement for the tactile feedback that provides. However, my app must run satisfactorily even if the user isn't using a hardware keyboard...

warmly,
Arun
Reply all
Reply to author
Forward
0 new messages