Stop my inputs activating keyboard on start

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Stop my inputs activating keyboard on start

Post by doobox » Wed May 25, 2011 9:07 pm

Hi there,

I cant find the right way to stop my text input field "feild1" from activating the keyboard on app start.

I have tried, on the card:
on preopencard
focus on nothing
end preopencard

Keyboard still becomes active and feild1 takes the focus.
Kind Regards
Gary

https://www.doobox.co.uk

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: Stop my inputs activating keyboard on start

Post by bn » Wed May 25, 2011 9:27 pm

Hi Doobox,

I suppose you have also a button on the card. You could send the button all the way back in the properties inspector (size and position) and in the properties inspector set the traversalOn to true, set the showFocusBorder to false.

When a card opens the focus goes to the first object (first as in layer the lower the number the 'firster') that is focusable. This way your field does not get the focus when opening a card and the keyboard does not pop up. The fact that the button gets the focus is of no matter and not visible if you set the showFocusBorder to false.

If you don't have a button on the card you could use this technique with another object that is focusable.

Kind regards

Bernd

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Stop my inputs activating keyboard on start

Post by doobox » Wed May 25, 2011 9:38 pm

Hi there,

Thank-you, that makes sense.

I was just trying to code:
Disable the keyboard before card opens
Focus nothing after card opens
Then re-enable the keyboard.

Not sure if that would work, did not finish it yet. But your method sounds a lot easier and one i will now adopt.
Kind Regards
Gary

https://www.doobox.co.uk

Post Reply