Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!neoucom!sam From: sam@neoucom.UUCP (Scott A. Mason) Newsgroups: comp.sys.mac.programmer Subject: Re: ENTER/Return in Modeless dialog Message-ID: <1721@neoucom.UUCP> Date: 17 Sep 89 01:38:21 GMT References: <419@castle.ed.ac.uk> Sender: wfd@neoucom.UUCP Reply-To: sam@neoucom.UUCP (Scott A. Mason) Organization: Northeastern Ohio Universities College of Medicine Lines: 23 In article <419@castle.ed.ac.uk> nick@lfcs.ed.ac.uk (Nick Rothwell) writes: >Modal dialogs interpret Return/Enter as a hit on button item #1, which >avoids newlines going into TextEdit fields. I want to do the same with >modeless dialogs. In particular, I *don't* want Return/Enter to put in >a newline (making the text disappear in a one-line TextEdit box). ... Firstly, IM-I p. 417 has some pretty good detail on how to interpret events in modeless dialogs. What I usually do is to call IsDialogEvent each time through the event loop. If it returns TRUE, go ahead and do any special processing of keys like command-keys, and return. (You'll still have to call your dialog with the proper item that was hit, i.e. 1 if return) You'll know if a key was hit by checking theEvent.what (or whatever your EventRecord is). If it was a keyDown, check theEvent.modifiers for the exact key that was hit. If the key is not one of the special keys you want to process, pass them along to DialogSelect for further handling. Hope this helps. I would highly recommend verifying this with IM-I, though. -- -------------------------------------------------------------------------------- "If it ain't broke, don't fix it," and certainly don't blame me. UUCP: {pitt,scooter,hal,cwjcc,aablue}!neoucom!sam INTERNET: sam@neoucom.UUCP Scott A. Mason, Coordinator of Systems Operations, NEOUCOM