# control.c File Reference

## Defines
#define | CHECK_CTRL(NAME, BIT)
## Typedefs
typedef SceCtrlData | Controls
## Functions
static void | initController ()
void | readButtons (SceCtrlData *pad_data, int count)
| UserdataStubs (Controls, Controls)
static int | Controls_read (lua_State *L)
static int | Controls_buttons (lua_State *L)
static int | Controls_analogX (lua_State *L)
static int | Controls_analogY (lua_State *L)
static int | Controls_equal (lua_State *L)
static int | Controls_wlan (lua_State *L)
| UserdataRegister (Controls, Controls_methods, Controls_meta)
void | control_init (lua_State *L)
## Variables
static const luaL_reg | Controls_methods []
static const luaL_reg | Controls_meta []

## Define Documentation

#define CHECK_CTRL | ( | NAME,
|  | BIT |  | ) |

Value:

    static int NAME(lua_State *L) \
    { \
            Controls *a = toControls(L, 1);\
            lua_pushboolean(L, (a->Buttons & BIT) == BIT); \
            return 1; \
    }

## Typedef Documentation

typedef SceCtrlData Controls

## Function Documentation

void control_init | ( | lua_State * | L | ) |

static int Controls_analogX | ( | lua_State * | L | ) | `[static]`

static int Controls_analogY | ( | lua_State * | L | ) | `[static]`

static int Controls_buttons | ( | lua_State * | L | ) | `[static]`

static int Controls_equal | ( | lua_State * | L | ) | `[static]`

static int Controls_read | ( | lua_State * | L | ) | `[static]`

static int Controls_wlan | ( | lua_State * | L | ) | `[static]`

static void initController | ( |  | ) | `[static]`

void readButtons | ( | SceCtrlData * | pad_data,
|  | int | count |
| ) |  |  |

UserdataRegister | ( | Controls | ,
|  | Controls_methods | ,
|  | Controls_meta |  |
| ) |  |  |

UserdataStubs | ( | Controls | ,
|  | Controls |  |
| ) |  |  |

## Variable Documentation

const luaL_reg Controls_meta[]`[static]`

Initial value:

     {
      {"__tostring", Controls_tostring},
      {"__eq", Controls_equal},
      {0, 0}
    }

const luaL_reg Controls_methods[]`[static]`

Initial value:

     {
            {"read", Controls_read},
            {"select", Controls_select },
            {"start", Controls_start },
            {"up", Controls_up },
            {"right", Controls_right },
            {"down", Controls_down },
            {"left", Controls_left },
            {"l", Controls_l },
            {"r", Controls_r },
            {"triangle", Controls_triangle },
            {"circle", Controls_circle },
            {"cross", Controls_cross },
            {"square", Controls_square },
            {"home", Controls_home },
            {"hold", Controls_hold },
            {"note", Controls_note },
            {"volup", Controls_volup },
            {"voldown", Controls_voldown },
            {"screen", Controls_screen },
            {"analogX", Controls_analogX},
            {"analogY", Controls_analogY},
            {"buttons", Controls_buttons },
            {"wlan", Controls_wlan },
      {0, 0}
    }