Native Input Text
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Native Input Text
Hi All,
I've searched the forum for an info but couldn't unfortunately find a clear solution.
I'm adapting an app to Android and when using the Native InputText after pressing "Return"(Done or Whatever), keyboard disappears but the cursor still flashes in the field. I've tried "focus on a button or anything else with no result, also "send mouseUp" to any object as well. Strangely when i touch anything on the screen then the "focus" or the flashing cursor goes away.
Any Hint? Thx in Advance
Tested on real device (Note 4), Last LC 6.7.1 CE, Mac Yosemite.
PS: Lengthy explanation just for clarity purposes.
I've searched the forum for an info but couldn't unfortunately find a clear solution.
I'm adapting an app to Android and when using the Native InputText after pressing "Return"(Done or Whatever), keyboard disappears but the cursor still flashes in the field. I've tried "focus on a button or anything else with no result, also "send mouseUp" to any object as well. Strangely when i touch anything on the screen then the "focus" or the flashing cursor goes away.
Any Hint? Thx in Advance
Tested on real device (Note 4), Last LC 6.7.1 CE, Mac Yosemite.
PS: Lengthy explanation just for clarity purposes.
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native Input Text
Try "focus on nothing" .
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native Input Text
Thx Jacque but already tried with no joy!
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Native Input Text
I think Jacque is correct with her 'focus on nothing'... maybe try it like this..
Code: Select all
on keyboardDeactivated
focus on nothing
end keyboardDeactivated
Re: Native Input Text
Thx Dixie but i have already used exactly the same code as yours with no results!
Re: Native Input Text
Does anyone has a working example on Android with the Native InputText with the Focus removed from the field when pressing 'Return" or when the 'keyboardDeactivated' message sent ?
Thx
Thx
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native Input Text
I haven't looked at this for a while but try putting the focus command in a returnInField handler in the field script. If that doesn't work try setting the autoTab property of the field to true. Either of those should remove the focus from the field.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Native Input Text
Jacque...
The poster is using native input fields...I haven't looked at this for a while but try putting the focus command in a returnInField handler in the field script. If that doesn't work try setting the autoTab property of the field to true. Either of those should remove the focus from the field.
Re: Native Input Text
Hi All,
I've found a workaround but not very elegant though in the card script :
on inputReturnkey
focus on fld "Whatever" --------------------(TraversalOn to True Already) so i can move from the native field
set the traversalOn of field "Whatever" of card "Menu" to false ----------Once there Remove its focus again
end inputReturnkey
on inputBeginEditing ------------------Setting Back the TraversalOn true so i can focus elsewhere again
set the traversalOn of field "Whatever of card "Menu" to true
end inputBeginEditing
Still the annoying part is that the keyboard message is triggered (notification bar) but keyboard not shown...........
i don't remember having to do all this stupid maneuver on iOS !!! I am sure there should be an easy way or it is just a bug!!!!!
Still investigating but any help is really appreciated! Thx
I've found a workaround but not very elegant though in the card script :
on inputReturnkey
focus on fld "Whatever" --------------------(TraversalOn to True Already) so i can move from the native field
set the traversalOn of field "Whatever" of card "Menu" to false ----------Once there Remove its focus again
end inputReturnkey
on inputBeginEditing ------------------Setting Back the TraversalOn true so i can focus elsewhere again
set the traversalOn of field "Whatever of card "Menu" to true
end inputBeginEditing
Still the annoying part is that the keyboard message is triggered (notification bar) but keyboard not shown...........
i don't remember having to do all this stupid maneuver on iOS !!! I am sure there should be an easy way or it is just a bug!!!!!
Still investigating but any help is really appreciated! Thx
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Native Input Text
Youks..
reading your last post, It seems that you are mixing LC fields with native input fields... for example you can't set the 'traversalOn' of a native field... maybe this is where your problems lie...
@Jacque.. Sorry about my post, I think you are understanding what is happening here more than I am..
reading your last post, It seems that you are mixing LC fields with native input fields... for example you can't set the 'traversalOn' of a native field... maybe this is where your problems lie...
@Jacque.. Sorry about my post, I think you are understanding what is happening here more than I am..
Re: Native Input Text
Hi Dixie Not at All !!
I created a Native field from which i store a string. On exiting that native field, on its on "inputReturnkey" message i "Focus on" a created invisible field in the card with its traversalOn value originally set to TRUE.
The original issue was i could never remve the focus from the native field even after trapping the inputReturnkey" message.
Focus on Nothing couldn't do anything but this is something already known or maybe an issue from either my Note 4 or LC.
I'm not working at this stage with any LC input text field.
I created a Native field from which i store a string. On exiting that native field, on its on "inputReturnkey" message i "Focus on" a created invisible field in the card with its traversalOn value originally set to TRUE.
The original issue was i could never remve the focus from the native field even after trapping the inputReturnkey" message.
Focus on Nothing couldn't do anything but this is something already known or maybe an issue from either my Note 4 or LC.
I'm not working at this stage with any LC input text field.
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native Input Text
Nope, I was assuming LC fields, so you were right. ReturnInField wouldn't do anything in a native field. But using "focus on nothing" within the "inputReturnkey" handler seems like it should work. If it doesn't, maybe it's easer to just force a scripted click somewhere on the card:Dixie wrote:@Jacque.. Sorry about my post, I think you are understanding what is happening here more than I am..
Code: Select all
click at 0,0
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native Input Text
Thx Jacque but this is very strange, when i apply "click" or "mouseUp" by code in a handler the code works but the focus remains on the native field but when i physically touch the screen (which is similar to the code in the handler) the focus is removed !??
Are there specific conditions to make the code remove the focus or should i report for a bug ?
Thx
Are there specific conditions to make the code remove the focus or should i report for a bug ?
Thx
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Native Input Text
At this point yes, I think it's time to report it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native Input Text
Hi Jacque,
I gave up with the idea of using the Native Input Text on Android as for the time being managing the "focus" on it seems not to be working.
I'm using the LC fields which is ok for my app at this stage.
I will report it as a bug.
Once again many thanks Jacque & Dixie for your time, and to All our community I Wish you a Happy New Year !!
I gave up with the idea of using the Native Input Text on Android as for the time being managing the "focus" on it seems not to be working.
I'm using the LC fields which is ok for my app at this stage.
I will report it as a bug.
Once again many thanks Jacque & Dixie for your time, and to All our community I Wish you a Happy New Year !!