Main Page   Modules   Related Pages  

Pad Functions

The pad system makes it possible to check if a button is held or pressed on a really easy way! More...

Functions

Variables


Detailed Description

The pad system makes it possible to check if a button is held or pressed on a really easy way!


Function Documentation

void hel_PadInit void   
 

Initialize the pad system.

Call this once at the beginning, to initialize the pad system.

See also:
hel_PadReset(), hel_PadReadState()

void hel_PadReadState void   
 

Read pad state.

This should be called once per frame.

After calling this function, the global variable hel_Pad holds the current states.

See also:
hel_PadInit(), hel_PadReset()

void hel_PadReset void   
 

Reset the pad system.

Call this to clear the pad states in the variable hel_Pad

See also:
hel_PadInit(), hel_PadReadState()


Variable Documentation

TPad hel_Pad
 

Variable which holds the Pad states.

After hel_PadReadState() has been called, the variable hel_Pad holds the recent pad states.

Here is a little example program:

void myFunction()
{
    // Initialize pad system
    hel_PadInit();

    // Infinite loop
    while(TRUE)
    {
        // Make sure its a new frame
        if(IsNewFrame)
        {
            // Read pad states
            hel_PadReadState();

            // Access pad variable
            // Check if button down has been pressed
            if(hel_Pad.Pressed.Down)
            {
                Go_One_Menu_Item_Down();
            }
            else
            if(hel_Pad.Pressed.Up)
            {
                Go_One_Menu_Item_Up();
            }

            IsNewFrame = FALSE;
        }
    }

    // reset pad system
    hel_PadReset();
}


Generated on Mon Jan 26 17:07:29 2004 by DoxyGen 1.3-rc1