mercy...Control-A and text selection revisited

Eric Chatonet eric.chatonet at sosmartsoftware.com
Thu Aug 2 03:01:22 EDT 2007


Hi Mark,

Le 1 août 07 à 18:14, Mark E. Powell a écrit :

> After a user enters cursor in a fld (its traversalOn property is  
> true), I want control-A to select the text of that fld.  How do I  
> do it?

Sarah answered yet in the case you have a menu bar but may be you  
have not :-)
A controlKeyDown handler will work if you put it in the card's script:

on controlKeyDown pKey
   switch pKey
   case "A"
     if the selectedfield <> empty then select text of the selectedfield
     break
   default
     pass controlKeyDown
   end switch
end controlKeyDown

In addition, if you want to have a button to select the text of the  
field also, just set the traversalOn of the button to false (it will  
not become the focused object when clicked) and in its script, refer  
to the above handler:

on mouseUp
   controlKeyDown "A" -- C
end mouseUp

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list