int32 DoControlPad (int32 whichPad, uint32 *pButton,int32
continuousBits)
This function fills pButton with the current state of the control pad. That is, it returns values defined in event.h:
ControlUp ControlDown ControlLeft ControlRight ControlA ControlB ControlC ControlStart ControlX ControlLeftShift ControlRightShift
InitControlPad()
. This is because of system restrictions on
item ownership and using items. InitControlPad()
and
InitEventUtility()
create message ports and message items,
which only the task which has created them can use. Hence,
DoControlPad()
can only be called by that same task. Other
tasks or threads which attempt this, will get errors due to not owning the
appropriate message ports and messages. To make this multi-thread capable, you would need to spawn off a thread that communicates directly with the event broker, and with all the other tasks that will consume event information.
InitControlPad
, KillControlPad