mobilecontrols and object scripts

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

mobilecontrols and object scripts

Post by cusingerBUSCw5N » Sat Nov 24, 2012 4:52 am

I have to use mobilecontrol fields on my android app because androids won't type into a field. Right now I have a close keyboard button that appears when the page opens - but I would prefer to have it pop up if text is entered into a field (the same time the keyboard pops up).

I am wondering if I can set a simple script -
on mousedown
set the vis of button "close_keyboard" to true
end mousedown

How do you do that with mobilecontrol?

I know about mobilecontrolcreate, mobilecontrolset, mobilecontrolget, mobilecontroldelete

There is a mobilecontroldo, but I'm not sure it is the right command or how to use it properly.

Thank you.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilecontrols and object scripts

Post by Klaus » Sat Nov 24, 2012 1:40 pm

Hi,

this is from the "Android Release Notes":
...
The following messages will be sent to the current card of the default stack when the keyboard is shown or hidden:
keyboardActivated
keyboardDeactivated
Handle these messages to move controls or change the display layout to take account of the restricted screen area that will be available.
...
Maybe this is what you are looking for?


Best

Klaus

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: mobilecontrols and object scripts

Post by cusingerBUSCw5N » Thu Nov 29, 2012 4:31 pm

not exactly - although this is not a big issue for me - it's more a curiosity.

I want to have
On mousedown
set the vis of button "keyboard_close" to true
end mousedown

...but there is nowhere to "put" these instructions - since is it is a mobilecontrol

Right now, I have the keyboard_close button visible if there is a mobilecontrol input field on the page...but it would be slicker to have it only popup if someone used that input field.

as I said, not a big deal - since my way is quite functional, just curious. "something" currently is telling it to open a keyboard when someone clicks on the input field - it would be nice to have it also open my keyboard close button.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilecontrols and object scripts

Post by Klaus » Thu Nov 29, 2012 5:09 pm

Hmmmm, sounds like this should work for you:

Code: Select all

on keyboardActivated
  set the vis of button "keyboard_close" to true
end keyboardActivated
If you mean to "put a mousedown script into the native field control", not?

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: mobilecontrols and object scripts

Post by cusingerBUSCw5N » Fri Nov 30, 2012 5:54 am

yes - but where do you put the code? can you put that on the card level? There's no "object" to attach the script...

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilecontrols and object scripts

Post by Klaus » Fri Nov 30, 2012 11:04 am

Yes, put it into the card script.

P.S.
Did you check this one already?
http://forums.runrev.com/phpBB2/viewtop ... 53&t=13453

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: mobilecontrols and object scripts

Post by cusingerBUSCw5N » Sun Dec 02, 2012 6:52 am

Doesn't work - on android that is.

keyboardactivated seems to be for ios only (per the library). I was looking for something that triggers for an android mobilecontrol input field. Something triggers the android to open a keyboard...I was just curious if you could add other things like making a close button visible.

not critical - and nothing that keeps me up at night (unlike other issues have!)

good to know that there is a solution for ios.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilecontrols and object scripts

Post by Klaus » Sun Dec 02, 2012 12:17 pm

keyboardactivated seems to be for ios only
Things ain't always what they seem to be!

This is from tha latest "Android Release Notes" (LC 5.5.3):
...
Activation notifications
The following messages will be sent to the current card of the default stack when the keyboard is shown or hidden:
keyboardActivated
keyboardDeactivated

Handle these messages to move controls or change the display layout to take account of the restricted screen area that will be available.
...

Post Reply

Return to “Android Deployment”