input.h File Reference

Go to the source code of this file.

Data Structures

struct  gc_pad_t

Defines

#define PAD_LEFT   (1 << 0)
#define PAD_RIGHT   (1 << 1)
#define PAD_DOWN   (1 << 2)
#define PAD_UP   (1 << 3)
#define PAD_Z   (1 << 4)
#define PAD_RS   (1 << 5)
#define PAD_LS   (1 << 6)
#define PAD_A   (1 << 8)
#define PAD_B   (1 << 9)
#define PAD_X   (1 << 10)
#define PAD_Y   (1 << 11)
#define PAD_START   (1 << 12)
#define PAD_ANY
#define GCPAD_0   (0)
#define GCPAD_1   (1)
#define GCPAD_2   (2)
#define GCPAD_3   (3)
#define GCPAD_ALL   (4)

Functions

int input_initialize (void)
 Initialize the input subsystem.
int input_shutdown (void)
 Shut down the input subsystem.
u16 pad_read (gc_pad_t *pad, int chan)
 Reads pad data.
void pad_rumble (int chan, BOOL on)
 Turns on/off rumble on GC pad.
u16 input_wait (void)
 Waits until a button is pressed on any pad.

Detailed Description

Performs all input management (front panel buttons and GC pad)


Define Documentation

#define GCPAD_0   (0)

First GC pad

#define GCPAD_1   (1)

Second GC pad

#define GCPAD_2   (2)

Third GC pad

#define GCPAD_3   (3)

Fourth GC pad

#define GCPAD_ALL   (4)

All GC pads

#define PAD_A   (1 << 8)

A button

#define PAD_ANY
Value:

A mask that matches all buttons

#define PAD_B   (1 << 9)

B button

#define PAD_DOWN   (1 << 2)

Down D-Pad button

#define PAD_LEFT   (1 << 0)

Left D-Pad button

#define PAD_LS   (1 << 6)

Left shoulder button

#define PAD_RIGHT   (1 << 1)

Right D-Pad button

#define PAD_RS   (1 << 5)

Right shoulder button

#define PAD_START   (1 << 12)

Start button

#define PAD_UP   (1 << 3)

Up D-Pad button

#define PAD_X   (1 << 10)

X button

#define PAD_Y   (1 << 11)

Y button

#define PAD_Z   (1 << 4)

Z button


Function Documentation

int input_initialize ( void   ) 

Initialize the input subsystem.

Initializes the input subsystem, registers necessary IRQs, and all other required initialization tasks.

Returns:
If initialization was successful, returns 1. Otherwise 0.
See also:
input_shutdown()
int input_shutdown ( void   ) 

Shut down the input subsystem.

Shuts down the input subsystem, unregisters the IRQs, and performs all other required shut down tasks.

Returns:
If shut down was successful, returns 1. Otherwise 0.
See also:
input_initialize()
u16 input_wait ( void   ) 

Waits until a button is pressed on any pad.

Returns:
The combined button states of all pads.
u16 pad_read ( gc_pad_t pad,
int  chan 
)

Reads pad data.

Reads data from the specified GC pad, and places it into a struct.

Parameters:
pad pointer to the gc_pad_t for the pad data to go.
chan which GC pad should be read.
Returns:
The button state. (the same as pad->btns_held)
void pad_rumble ( int  chan,
BOOL  on 
)

Turns on/off rumble on GC pad.

Parameters:
chan which GC pad should have rumble status changed.
on if TRUE, turns on rumble. If FALSE, turns off rumble.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3