[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