keystroke transformations

Richard Gaskin ambassador at
Sun Feb 22 03:24:54 EST 2009

viktoras wrote:

 > Richard Gaskin wrote:
 >> That's the natural built-in behavior of the engine: when you strike
 >> either the Enter or Return keys, the cursor in the field moves down
 >> to the beginning of the next line.
 >> Is there something else at play here that I missed?
 > Yes, therefore I wish to prevent this natural behaviour, as it also
 > moves all the text into the new line. What I am after is blocking
 > enter, return and passing arrow down instead, so the text in a field
 > would remain intact, but cursor moves to the next line without any
 > changes to the text.

Gotcha. Thanks for the clarification.  Give this a whirl and see if it 
does what you need -- these handers would go in a field script:


on enterInField
end enterInField

on returnInField
end returnInField

on DoMoveDown
   put (word 2 of the selectedLine) into tLine
   if tLine = the number of lines of me then
     put cr after me
   end if
   select before line (tLine+1) of me
end DoMoveDown

  Richard Gaskin
  Fourth World
  Revolution training and consulting:
  Webzine for Rev developers:

More information about the Use-livecode mailing list