Page 1 of 1

Detect focus on native control

Posted: Sat Nov 23, 2013 7:48 pm
by mikek
Is it possible to detect that an android app user has moved the focus to a native text control? I cannot see any way of doing this.

Re: Detect focus on native control

Posted: Sun May 03, 2015 11:02 pm
by MaxV
This is my solution:
########CODE#######

on InputbeginEditing
set the spostacontrollo of me to empty
put mobilecontroltarget() into nomec #control name
put mobilecontrolget(nomec,"rect") into rectc #control rect
#check if a native control is visible
#corner top left
put item 1 to 2 of rectc into altosx #corner bottom rigth
put item 3 to 4 of rectc into bassodx #angolo alto
if (altosx is not within the effective working screenrect) or (bassodx is not within the effective working screenrect) then
set the spostacontrollo of me to (nomec & CR & rectc)
mobilecontrolset nomec,"rect",the effective working screenrect
end if
end InputbeginEditing

on inputEndEditing
riportatuttoaposto
end inputEndEditing

on riportatuttoaposto
put the spostacontrollo of me into temp
put line 1 of temp into nomec
put line 2 of temp into rectc
mobilecontrolset nomec,"rect",rectc
end riportatuttoaposto

on keyboarddeactivated
riportatuttoaposto
end keyboarddeactivated

#####END OF CODE#####

Re: Detect focus on native control

Posted: Mon May 04, 2015 10:30 pm
by jekyllandhyde
mikek,

If you find a solution please let me know. I want to use ask... to present a native modal and not have to require the user to finger press into the text field area before the numeric keyboard will appear. Basically to mimic IOS functionality.