How should i use "enterKey" handler when entering text

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

How should i use "enterKey" handler when entering text

Post by Ultravibe » Sat Jan 17, 2015 12:22 pm

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

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Sat Jan 17, 2015 12:59 pm

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

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

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

Post by Ultravibe » Sat Jan 17, 2015 2:48 pm

Thanx, Klaus! It works!!!!!! (returnInField)

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

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

Post by Ultravibe » Sat Jan 17, 2015 3:17 pm

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?

zaxos
Posts: 222
Joined: Thu May 23, 2013 11:15 pm

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

Post by zaxos » Tue Jan 20, 2015 12:14 pm

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...
Knowledge is meant to be shared.

Post Reply