mercy...Control-A and text selection revisited

Sarah Reichelt sarah.reichelt at gmail.com
Wed Aug 1 19:20:29 EDT 2007


On 8/2/07, Mark E. Powell <runrev at aboutmyfiles.com> wrote:
> Sorry, the archives are not solving this for me and I need to throw myself on the mercy of the list.
>
> 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?
>
> The focusedObject is the fld, but the controlkeydown message is never received by the field.  Clicking outside the field makes the focusedObject the card, but when pressing control-A then the controlKeyDown message is not received by the card either.  A test button that says
>
>   on mouseUp
>     select text of fld "dump"
>   end mouseUp
>
> does select the text of the field successfully.  All the foregoing in both IDE and standalone.  Rev 2.8 Build 360.

Are you using a custom menu bar or the default Rev menu bar? If you
have the Rev menu bar it should just work. If you have a custom menu
bar, then add "Select All" to the Edit menu, give it the shortcut you
want, and then add this section to the Edit menu buttons script:

  case "Select All"
    put the focusedObject into tID
    if tID contains "field" then
      select text in tID
    end if
    break

This assumes you have a standard menu handler using a switch.

HTH,
Sarah



More information about the use-livecode mailing list