Page 1 of 1

[SOLVED] Refocus On Edit Field

Posted: Thu Apr 12, 2018 11:45 am
by Googie85
Hi Guys,

When I focus on an edit field, the keyboard presents fine, but after I move from the edit field, and refocus on it, the keyboard dose not reappear.

Any Ideas?

Many Thanks,

Matthew.

Re: Refocus Of Edit Field

Posted: Fri Apr 13, 2018 11:54 am
by sphere
Please share your script, that would help.

Re: Refocus Of Edit Field

Posted: Fri Apr 13, 2018 7:05 pm
by richmond62
the keyboard presents fine
Do you mean that this is running on Android or iOS and the onscreen keyboard appears?

Re: Refocus Of Edit Field

Posted: Fri Apr 13, 2018 7:34 pm
by bogs
Googie85 wrote:
Thu Apr 12, 2018 11:45 am
When I focus on an edit field, the keyboard presents fine, but after I move from the edit field, and refocus on it, the keyboard dose not reappear.
Any Ideas?
Well, you could intercept the message, which would be openField, and possibly pop the keyboard that way?

Code: Select all

on openField -- triggered when clicking in the field
  set the keyboardActivated to true
end openField
*Disclaimer - I don't develop for mobile, take with grain of salt.

Re: Refocus Of Edit Field

Posted: Fri Apr 13, 2018 7:41 pm
by richmond62
Um . . .

How about using on focusIn instead of openField ?

*Disclaimer - I don't develop for mobile, take with several grains of natural, Himalayan salt.

Re: Refocus Of Edit Field

Posted: Fri Apr 13, 2018 9:27 pm
by bogs
That sounds good too :mrgreen:

*Disclaimer - I don't develop for mobile, take with several abominable snowmen.

Re: [SOLVED] Refocus Of Edit Field

Posted: Fri Apr 13, 2018 11:44 pm
by Googie85
Thanks, you guys are awesome!!

Re: [SOLVED] Refocus On Edit Field

Posted: Tue Aug 04, 2020 11:38 am
by trevix
"set the keyboardActivated to true" will never work, because is a message sent to the current card. Can't be set.

I am having the same problem, that is:
- click on a Android (7.0 hardware) field in order to edit. OK
- write your stuff and click on a different field in order to write or edit the second field
- the keyboard disappear (noOK)

This doesn't happens on iOS

Re: [SOLVED] Refocus On Edit Field

Posted: Tue Aug 04, 2020 12:24 pm
by trevix
Whatever it means, I discovered that if I put this in the 2 fields, the keyboard behave correctly:

Code: Select all

on openField
     if environment() = "mobile" then
          answer "something"
     end if
end openField
Now I only need to find something a little less "intrusive"...

Re: [SOLVED] Refocus On Edit Field [NOW IS SOLVED]

Posted: Tue Aug 04, 2020 1:12 pm
by trevix
OK. I I put this on the 2 fields, the keyboards behave correctly.

Code: Select all

on openField
     if environment() = "mobile" then
          wait 10 milliseconds
          focus on me
     end if
end openField
It shouldn't need this, tought