Page 1 of 1

Text entry field, limit characters and script? [solved]

Posted: Sun Jul 07, 2013 11:05 pm
by trenatos
So I'm messing with my chat application, and I'm trying to figure out how I can 1. limit the text in the text box. 2. Trigger a script when the user hits the Enter key. 3. Use the tab key to move from the text box to the send key.

I tried messing with the tab order (Layer order) but all it tabs between are two text fields.
A text entry field and a scrolling field, it does not want to tab to buttons.

Re: Text entry field, limit characters and executuing script

Posted: Mon Jul 08, 2013 3:41 am
by dunbarx
Hi.

Look up the "tabKey"message and the "enterInField" message in the dictionary. Should be easy with a few experiments.

When you say limit the text, what exactly do you mean? To one line? To a certain string length? To certain characters only?

Write back...


Craig Newman

Re: Text entry field, limit characters and executuing script

Posted: Mon Jul 08, 2013 4:30 am
by trenatos
I just found the answer to the enter thing, indeed enterInField and returnInField solved the issue.

Limiting the fields to x characters, which I also found the answer to, a simple script for onKeyDown that counts the characters in the field, if under the limit the pass.

:)