Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!infonode!ingr!b17b!shaman!wolf From: wolf@shaman.ingr.com (Wayne Wolf) Newsgroups: comp.lang.pascal Subject: Queueing multiple events in a Turbo Vision application Keywords: Turbo Vision, Pascal, Events, Queue Message-ID: <637@b17b.INGR.COM> Date: 14 Jan 91 21:46:54 GMT Sender: usenet@b17b.INGR.COM Reply-To: ...!uunet!ingr!wyle!shaman!wolf Organization: Intergraph Corporation Lines: 63 I'm currently developing a Turbo Vision application and have encountered a minor stumbling point in the implementation. The application can be run with the user at hand or can be run unattended. Ideally it is desirable to produce only one set of code designed to handle the case where the user is at the terminal. To automate it would merely require a procedure that would spool a series of events (mostly keyboard presses) to the main event handler, simulating a user creating these events. The code is there already to handle this stream of events and no extra code is required to process an automated request save that to spool the events into the event queue. My dilemma is this: I do not see a mechanism that allows me to queue up these events. There exists a method for Views called PutEvent(Event) which allows me to put an event into the event queue. But, this is not helpful as it only allows ONE event to be put into the queue, and placing a group of these calls together has the net effect of only having the last call in the list place an event in the queue. I want to steer away from writing my own 'keyboard buffer inserter endall dohickey' mechanism if at all possible. Does anyone know how to sneak into the guts of the event handler and add new events to the end of the queue? Or, worst case, a pointer to some example source code that will monitor the keyboard buffer and when it drains to a sufficient level, pump in more keypresses (automated) from a user defined buffer. Ideally I'd like to be able to call a method, say PlaceEventInQueue(NextEvent), where my code would be as follows: ------ Procedure Automate; Var NextEvent: TEvent; Begin with NextEvent do begin What := evKeyDown; InfoPtr := Nil; KeyCode := kbF3; PlaceEventInQueue(NextEvent); (* simulate F3 press *) KeyCode := kbTab; PlaceEventInQueue(NextEvent); (* simulate Tab press *) KeyCode := kbEnter PlaceEventInQueue(NextEvent); (* simulate Enter press *) end; {with NextEvent} End; ------ To the application, when calling this procedure, it would appear as if the user had pressed F3, Tab, and then Enter. Any suggestions are appreciated. Thanx in advance. .. Wayne Wolf USENET : ...!uunet!ingr!wyle!shaman!wolf (try this one first) Internet: ww@beach.cis.ufl.edu