autoHilite and focus (following Jacque's solution)

J. Landman Gay jacque at hyperactivesw.com
Wed Jul 6 12:52:07 EDT 2011


On 7/6/11 2:06 AM, Slava Paperno wrote:
> But then I added other buttons to the same card, and found that if any of
> them has AutoHilite set to true, my focus command is undone, and the focus
> moves to the card itself as soon as the mouseUp handler is done in the Find
> button. I do want the user to see the visual feedback from those buttons,
> and I don't want their Focus with Keyboard property set to true.

I think what you're seeing is the engine's long-standing behavior that 
automatically focuses on the first object that has traversalOn set to 
true whenever the card changes. On Windows/Linux, it can be a button. On 
OS X, where buttons by default don't respond the same way, it's a field. 
This has been known to drive developers gibbering into the streets, and 
I wish there were a way to turn that off.

But since we're stuck with it, one solution is to make your Find field 
the first one (the lowest layer) if possible. Or, see my suggestion in 
my other post. Or add an (ugly) command to an openCard handler that 
sends a message in 1 millisecond to another handler, which in turn 
focuses on nothing (or on your field if you prefer.)

>
> With the focus gone, my user will probably try to press Tab to return the
> focus to the input field. But when the focus is on the card, none of my
> buttons receives that Tab keypress.

Put the tabkey handler into the stack or card and check "the target" to 
see which object received the message.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list