Wii: Add analog support for menuing

This commit is contained in:
Jeffrey Pfau 2015-08-28 21:42:39 -07:00
parent c0d19a1ad5
commit 9565e8830c
1 changed files with 14 additions and 0 deletions

View File

@ -382,6 +382,20 @@ static int _pollInput(void) {
WPAD_Probe(0, &ext);
int keys = 0;
int x = PAD_StickX(0);
int y = PAD_StickY(0);
if (x < -0x40) {
keys |= 1 << GUI_INPUT_LEFT;
}
if (x > 0x40) {
keys |= 1 << GUI_INPUT_RIGHT;
}
if (y < -0x40) {
keys |= 1 << GUI_INPUT_DOWN;
}
if (y > 0x40) {
keys |= 1 << GUI_INPUT_UP;
}
if ((padkeys & PAD_BUTTON_A) || (wiiPad & WPAD_BUTTON_2) ||
((ext == WPAD_EXP_CLASSIC) && (wiiPad & (WPAD_CLASSIC_BUTTON_A | WPAD_CLASSIC_BUTTON_Y)))) {
keys |= 1 << GUI_INPUT_SELECT;