Spiking the focus
livfoss at mac.com
Tue Oct 2 11:00:17 EDT 2012
I'm having trouble running some very simple tests of iOS keyboard input, and one problem is that I want the iOS keyboard to come up when the user touches a specific field (or the mouse clicks in the Simulator). These fields are locked with TraversalOn set to true as is usual for iOS keyboard input.
This isn't working, no doubt due to some stupidity on my part (I'm sending another message about this), but while I was testing I found that one of my fields (field number 1) in my very simple test stack was receiving the focus as soon as the card was opened when my script wasn't expecting it. I was surprised after all this time to find the following in the LC documentation:
> When a card is opened, LiveCode automatically focuses the first object on the card that is capable of receiving the keyboard focus.
Somehow I never noticed this before.
I don't like this and would like to stop it, but even when I arrange for the fields to have their TravesalOn false on loading and only set it on again during an OpenCard handler, I still get the unwanted focussing. If I leave the TraversalOns false and don't change them, then the card triggers a focusIn handler, which is equally unwanted.
Do I have to live with this or is there a workaround?
More information about the Use-livecode