Text Box dilemna

Klaus Major klaus at major-k.de
Tue Dec 23 16:38:27 EST 2003


Hi Stewart,

> I need to find a way to trap and stop anyone from deleting selected 
> text.
> For example, in a text field, if one selects text and hits any key
> (including delete, return, fwd delete or enter),  I need the the 
> keypress
> to be ignored and the selection disappear.
> IE, I only want people to be able to hit the backspace (delete) key and
> delete one character at a time and only if there is no text selected at
> the time of pressing the key.  I need to stop it before it happens, or 
> if
> it does happen, undo it immediately without user intervention.
>
> Any suggestions?

Yo :-)

Put this in your card or field script:

on backspacekey
   ## do your own backspace thing here...
end backspacekey

Ad lib the same with:

deletekey, returninfield and enterinfield...

Hope this helps...

> :  o/  : Stewart Lynch
> : <|   : Director of Instruction, Technology and Information Services
> : / >  : Richmond School District
> :......:   Richmond, BC Canada
> Internet: slynch at richmond.sd38.bc.ca
> https://public.sd38.bc.ca/~slynch
> tel. (604) 668-6128 fax: (604) 668-6006
> *******************************************

Regards

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the use-livecode mailing list