How do I get input from Classic Controller?
Posted: Tue May 22, 2012 9:36 pm
How do I check if the classic controller is plugged in and read input from it?
Professional toolchains, amateur prices
https://devkitpro.org./
Code: Select all
WPAD_Expansion(WPAD_CHAN_0, &e);
Code: Select all
expansion_t e;
while (1) {
WPAD_ScanPads();
WPAD_Expansion(WPAD_CHAN_0, &e);
if (e.type == EXP_CLASSIC) {
printf("\x1b[2;2H");
printf("Left JS={%i,%i} RightJ JS={%i,%i}\n", (int)e.classic.ljs.pos.x, (int)e.classic.ljs.pos.y, (int)e.classic.rjs.pos.x, (int)e.classic.rjs.pos.y);
if (e.classic.btns & CLASSIC_CTRL_BUTTON_HOME)
break;
}
}