Note: The convenience calls are "single threaded." Only one thread within any application can use them at a time.
Err InitEventUtility(int32 numControlPads, int32 numMice,int32 focusListener);
numControlPads
sets the maximum number of controller pads the task wants to monitor.
numMice
sets the maximum number of mice the task wants to monitor. These values should be an integer of 0 or higher.
focusListener
is a Boolean value that sets the focus of the task when it is connected as a listener. If the parameter is true (nonzero), the task is connected as a focus-dependent listener. If the parameter is false (0), the task is connected as a focus-independent listener.
Err GetControlPad(int32 padNumber, int32 wait, ControlPadEventData *data);
padNumber
sets the number of the generic controller pad on the control port (i.e., the first, second, third, and so on, pad in the control port daisy chain, counting out from the 3DO unit) that the task wants to monitor. The first pad is 1, the second is 2, and so on.
wait
is a Boolean value that specifies the event broker's response to this call. If it is true (nonzero), the event broker waits along with the task until an event occurs on the specified pad, and returns data only when there is a change in the pad. If it is false (0), the event broker immediately returns with the status of the pad.
data
is a pointer to a ControlPadEventData structure that shows where memory was allocated for the returned control pad data to be stored. (The task must create an instance of this data structure before it executes GetControlPad()
).
This call performs the same function as GetControlPad()
, but gets events from a specified mouse instead of a specified controller pad:
Err GetMouse(int32 mouseNumber, int32 wait, MouseEventData *data);
GetControlPad(),
but mouseNumber
specifies a mouse on the control port instead of a controller pad, and the pointer data is now a pointer to a data structure for storing mouse event data instead of controller pad event data.
InitEventUtility()
call:
Err KillEventUtility(void);