Native Input Text

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Native Input Text

Post by Youks » Sat Dec 27, 2014 1:32 pm

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 :D

Tested on real device (Note 4), Last LC 6.7.1 CE, Mac Yosemite.

PS: Lengthy explanation just for clarity purposes. :wink:

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Native Input Text

Post by jacque » Sat Dec 27, 2014 5:08 pm

Try "focus on nothing" .
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Sat Dec 27, 2014 5:50 pm

Thx Jacque but already tried with no joy! :(

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Native Input Text

Post by Dixie » Sat Dec 27, 2014 7:50 pm

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

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Sat Dec 27, 2014 8:43 pm

Thx Dixie but i have already used exactly the same code as yours with no results! :?

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Sun Dec 28, 2014 8:37 am

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Native Input Text

Post by jacque » Sun Dec 28, 2014 9:00 am

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Native Input Text

Post by Dixie » Sun Dec 28, 2014 9:22 am

Jacque...
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.
The poster is using native input fields...

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Sun Dec 28, 2014 9:48 am

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Native Input Text

Post by Dixie » Sun Dec 28, 2014 10:05 am

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..:-)

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Sun Dec 28, 2014 10:57 am

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.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Native Input Text

Post by jacque » Sun Dec 28, 2014 9:52 pm

Dixie wrote:@Jacque.. Sorry about my post, I think you are understanding what is happening here more than I am..:-)
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:

Code: Select all

click at 0,0
That would simulate what happens when the user manually clicks out of the field. It does seem like there should be a way to remove the insertion point though. iOS offers the ability to disable a native field, which might do it, but that isn't available on Android.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Mon Dec 29, 2014 9:45 am

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Native Input Text

Post by jacque » Mon Dec 29, 2014 6:03 pm

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

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: Native Input Text

Post by Youks » Mon Dec 29, 2014 6:33 pm

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 !! :D

Post Reply

Return to “Android Deployment”