'From Squeak3.1alpha of 28 February 2001 [latest update: #4284] on 23 August 2001 at 9:27:22 pm'! "Change Set: TextCRAction-ar Date: 23 August 2001 Author: Andreas Raab Add a #crAction in text fields."! !TextMorph methodsFor: 'accessing' stamp: 'ar 8/23/2001 21:23'! crAction "Return the action to perform when encountering a CR in the input" ^self valueOfProperty: #crAction! ! !TextMorph methodsFor: 'accessing' stamp: 'ar 8/23/2001 21:23'! crAction: aMessageSend "Return the action to perform when encountering a CR in the input" ^self setProperty: #crAction toValue: aMessageSend! ! !TextMorph methodsFor: 'editing' stamp: 'ar 8/23/2001 21:25'! keyStroke: evt "Handle a keystroke event." | action | evt keyValue = 13 ifTrue:["CR - check for special action" action _ self crAction. action ifNotNil:[ "Note: Code below assumes that this was some input field reacting on CR. Break the keyboard focus so that the receiver can be safely deleted." evt hand newKeyboardFocus: nil. ^action value]]. self handleInteraction: [editor readKeyboard] fromEvent: evt. self updateFromParagraph. super keyStroke: evt "sends to keyStroke event handler, if any"! !