Page 1 of 1

Enter Key and Text Fields

Posted: Thu Jul 24, 2014 6:31 pm
by starfirescully
I am having a really frustrating time with the enter key. I know that when you use it in in a text field is sends the message enterInField instead of enter. I am working on the flashcard app in livecode university.

This is what I need to happen:

When finished typing the answer in the response field. Press Enter. When enter is pressed then run mouseUp in button CheckAnswer. Here is the code I have

on enterKey
send "mouseUp" to button "CheckAnswer"
end enterKey


How can I get this to run when pressing enter in a text field instead of enterInField?

I have already tried moving the code up the message hierarchy to a group, the card, and the stack. I have literally tried everything I can think of.

Thanks in advance!

Re: Enter Key and Text Fields

Posted: Thu Jul 24, 2014 6:42 pm
by starfirescully
I think I have it now!

using

on returnInField
send "mouseUp" to button "CheckAnswer"
end returninField


seems to work! :)

Re: Enter Key and Text Fields

Posted: Thu Jul 24, 2014 6:47 pm
by Klaus
Yep :D

ENTER <> RETURN!

Re: Enter Key and Text Fields

Posted: Thu Jul 24, 2014 6:48 pm
by magice
starfirescully wrote:I think I have it now!

using

on returnInField
send "mouseUp" to button "CheckAnswer"
end returninField


seems to work! :)
It sounds like you ran into the same issue I did a few months back. The "enter" key is the one to the right of the number pad, not the return. It threw me until I read a tiny note in the LC dictionary.

Re: Enter Key and Text Fields

Posted: Thu Jul 24, 2014 6:50 pm
by Klaus
Get to know your hardware, guys! 8)

Re: Enter Key and Text Fields

Posted: Sat Jul 26, 2014 3:19 am
by Simon

Code: Select all

on returnInField
send "mouseUp" to button "CheckAnswer"
end returninField

on enterKey
returnInField
end enterKey
Simple

Simon
hey... who said that? :D