preventing deletion of linefeds

Jim Ault JimAultWins at
Wed Dec 6 14:31:40 EST 2006

On 12/6/06 10:42 AM, "Viktoras Didziulis" <viktoras at> wrote:

> can anybody suggest a simple method to prevent users deleting linefeeds in a
> text field when pressing backspace or delete keys. It should allow deletion
> of any other symbol which is not "return" and should not use table object at
> all. 
> What should be added into the handler below?
> Chunk expression (word 2 of the selectedchunk) > 1 does not work...
> on backspaceKey 
> if ??? then 
> pass backspaceKey
> end if 
> end backspaceKey

 Normally I think this is done using a combo box so that one line at a time
is edited and the list is select-only (list behavior)

If you do try to capture key strokes, you need to decide how would you stop
multi-line user select, then a single delete... or
multi-line user select, then pressing another key to replace 3 lines with
one character.

Then there is cut, copy, paste...

Jim Ault
Las Vegas

More information about the Use-livecode mailing list