Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!netcom!hue From: hue@netcom.UUCP (Jonathan Hue) Newsgroups: comp.sys.next Subject: Re: Fake events Keywords: fake event FrameMaker Message-ID: <6039@netcom.UUCP> Date: 24 Jan 90 06:22:02 GMT References: <1465@mit-amt.MEDIA.MIT.EDU> <11873@csli.Stanford.EDU> Organization: NetCom- The Bay Area's Public Access Unix System {408 249-0290 guest} Lines: 23 In article <11873@csli.Stanford.EDU> dayglow@csli.stanford.edu (Eric T. Ly) writes: >In article <1465@mit-amt.MEDIA.MIT.EDU> howcome@mit-amt.MEDIA.MIT.EDU (Hakon W Lie) writes: >>I am trying to port an application from sun/x-windows to NeXT. In X11 >>I can send generate events (like keyclicks, buttonpresses etc.) >>through XSendEvent. Is something similar possible on the NeXT ? > >event record and stuff the fields with the appropriate values. Then, >you could just do a [NXApp sendEvent:&theEvent]. Of course, this If you do this you will soon find that you need to use DPSPostEvent() also. The problem is that your app will often go into a loop doing DPSGetEvent() if it gets a mouse-down event on a gadget. So you end up having to shove a bunch of mouse-moves and a mouse up into the event queue with DPSPostEvent() before sending the mouse-down. >requires that you find the correct Mach port to which to send events >and that you have send rights to it, none of which seems possible >without the help of the other application. "help", as Eric knows, consists of a command line option when starting the app. -NXPSName or something like that. -Jonathan