Native Input Text

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Native Input Text

Post by Simon » Mon Dec 29, 2014 7:16 pm

Hi Youks,
I usually just use a hidden button (vis false) and set the focus to that when I want to get rid of the keyboard and cursor. Just have the focus with keyboard and show focus border selected.
Watch-out for keyboardDeactivated, a "soft keyboard down" wont activate the message.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

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

Re: Native Input Text

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

Hi Simon,

I've tried your trick with buttons,field,graphics etc... I could not get the focus to move out of a native input text !!
i managed to play with the tranversalOn property, it works that way but triggers unnecessarily the keyboard.

i'm using LC 6.7.1 (latest) C.E. and testing on Note 4 .

It could be cool to check if your trick still works on the version i'm using.

Thx for your input.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Native Input Text

Post by Simon » Mon Dec 29, 2014 9:16 pm

Hi Youks,
Start a new stack and put this into the card script

Code: Select all

local sinputId

on opencard
   if environment() = "mobile" then
      mobileControlCreate "input"
      put the result into sinputID
      mobileControlSet sinputID, "rect", "38,113,361,156"
      mobileControlSet sinputID, "visible", "true"
      mobileControlSet sinputID, "opaque", "true"
   end if
end opencard

on closeCard
   mobileControlDelete sinputId
end closeCard

on mouseUp
   focus on btn 1
end mouseUp

on errorDialog pExecutionError, pParseError
answer "An error occurred on line: " & item 2 of line 1 of pExecutionError & cr & pExecutionError
end errorDialog
Add a button (that can be focused) on the card and run on the device.

Yes? :D
No? :cry:

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

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

Re: Native Input Text

Post by Youks » Mon Dec 29, 2014 9:49 pm

Hi Simon,

This doesn't work unfortunately!!!!!!!

:cry:

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Native Input Text

Post by Simon » Mon Dec 29, 2014 9:56 pm

hmmm...
Maybe it has to do with the device (or I misunderstood everything).
nativeFocus.zip
(1.19 KiB) Downloaded 216 times
Try that, it is working here.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

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

Re: Native Input Text

Post by Youks » Mon Dec 29, 2014 10:09 pm

I tried that one and unfortunately no joy !!!!!!!

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

Re: Native Input Text

Post by Youks » Mon Dec 29, 2014 10:16 pm

I've reported it as a bug and will investigate more tomorrow on another device. i'm not sure if it is only LC issue or Kitkat or Android SDK version.....a bit confused at this stage. For my app i am working for the time being with LC fields until UFN.

Thx for the help.

Post Reply