[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

Typically, input events are internally generated by the timer device,
keyboard device, and input device.

An application can also generate an input event by setting the appropriate
fields for the event in an InputEvent structure and sending it to the
input device. It will then be treated as any other event and passed
through to the input handler chain.  However, I/O requests for
IND_WRITEEVENT cannot be made from interrupt code.

You generate an input event by passing an IOStdReq to the device with
IND_WRITEEVENT set in io_Command, a pointer to an InputEvent structure set
in io_Data and the length of the structure set in io_Length.

   struct InputEvent *FakeEvent;
   struct IOStdReq   *InputIO;

   InputIO->io_Data=(APTR)FakeEvent;
   InputIO->io_Length=sizeof(struct InputEvent);
   InputIO->io_Command=IND_WRITEEVENT;
   DoIO((struct IORequest *)InputIO);

   You Know What Happens When You Assume.
   --------------------------------------
   This command propagates the input event through the handler chain.
   The handlers may link other events onto the end of this event or
   modify the contents of the data structure you constructed in any way
   they wish. Therefore, do not assume any of the data will be the same
   from event to event.

 Setting The Position Of The Mouse