Page 1 of 1

How should i use "enterKey" handler when entering text

Posted: Sat Jan 17, 2015 12:22 pm
by Ultravibe
I can't figure out why enterKey handler doesn't work.
I use "Text entry field" controlle to enter the text from application. In script of this object i've got this:

on enterKey
-- some actions

-- some actions
end enterKey

and this actions doesn't executing. I even add the command (put "Enter key is pressed") to see if this handle suddenly works? (enterKey)
but :(
Help me, please

Re: How should i use "enterKey" handler when entering text

Posted: Sat Jan 17, 2015 12:59 pm
by Klaus
Hi Ultravibe,

1. welcome to the forum! :D

2. Please don't:
Ultravibe wrote:Help me, please
This is the MEANING of a forum! 8)

3. Do not use ENTERKEY (check the dictionary for an expanation!)!
You need ENTERINFIELD (and/or RETURNINFIELD):
on enterInField
-- some actions
-- some actions
end enterInField


Best

Klaus

Re: How should i use "enterKey" handler when entering text

Posted: Sat Jan 17, 2015 2:48 pm
by Ultravibe
Thanx, Klaus! It works!!!!!! (returnInField)

Re: How should i use "enterKey" handler when entering text

Posted: Sat Jan 17, 2015 3:17 pm
by Ultravibe
Klaus, btw, one more question)))))
when i use "text field entry", i puting the pre-assigned value to this field (it's like default text).
I wanna highlight this text when stack is opening. It means that text will be deleted by entering any new characters (or pressing backspace, delete etc.)
And remains the same if i just hit Enter. it's the same when i select several characters with mouse.
So, how can i highlight the text?

Re: How should i use "enterKey" handler when entering text

Posted: Tue Jan 20, 2015 12:14 pm
by zaxos
Hello from me too, to hilite the text of a field you would use the folowing code:

Code: Select all

select text of fld 1
or if you want to select just 1 line"

Code: Select all

select line 1 of fld 1
or if you want 1 word:

Code: Select all

select word 1 of fld 1
and goes on...