Android Keyboard Activation Issue
andrew at midwestcoastmedia.com
andrew at midwestcoastmedia.com
Thu Jan 12 11:47:58 EST 2017
Here is a card script I'm currently using that seems to work in an
iOS/Android app I have now:
on preOpenCard
inputCreateTsm
end preOpenCard
on inputCreateTSM
put the rect of graphic "tsmRectangle" into tThisRect
# do some math to visually accommodate a roundedRect with innerShadow
add 15 to item 1 of tThisRect
subtract 10 from item 3 of tThisRect
mobileControlCreate "input", "TSMinput"
mobileControlSet "TSMinput", "rect", tThisRect
mobileControlSet "TSMinput", "text", line 1 of gCurrentPrefs
mobileControlSet "TSMinput", "keyboardType", "number"
mobileControlSet "TSMinput", "fontSize", 21
mobileControlSet "TSMinput", "fontName", "Roboto Light" -- iOS only
mobileControlSet "TSMinput", "textAlign", "center"
mobileControlSet "TSMinput", "visible", true
# make sure the field has focus, which activates the keyboard
mobileControlDo "TSMinput", "focus"
end inputCreateTSM
on closeCard
# delete the native text input
mobileControlDelete "TSMinput"
end closeCard
> Date: Thu, 12 Jan 2017 03:44:19 +0000
> From: "Daniel Pierce" <dpierce at xpertassist.com>
> To: "'Daniel Pierce via use-livecode'" <use-livecode at lists.runrev.com>
> Subject: Android Keyboard Activation Issue
> Message-ID:
> <0101015990c6b871-5fd4abdc-5e55-49b8-9a80-9c172ffe6fee-000000 at us-west-2.amazonses.com>
>
> Content-Type: text/plain; charset="us-ascii"
>
> List,
>
> I have developed a cross platform mobile app for iOS and Android using
> LiveCode and it is working OK, but I continue to get a common complaint from
> Android users that when they select a field the keyboard does not activate
> like on other apps.
>
> This is not an issue on iOS because a when you create the Native Text Box,
> you can send the command mobileControlDo <id> "focus" and the keyboard is
> activated with a single touch to the text entry field.
>
> Android doesn't support this capability so the users needs to touch the
> field to activate the Native Text Box and then touch it again to bring up
> the keyboard.
>
> Has anyone found a way to bring up the virtual keyboard when the Native Text
> Box has been created????
>
> Thanks for your advice.
> Dan
More information about the use-livecode
mailing list