From be30578bf30063b5e906f7de26a956810fedfcd4 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 29 Mar 2022 18:27:42 -0700 Subject: [PATCH] Allow dpad to navigate DJUI menus --- src/pc/djui/djui_interactable.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pc/djui/djui_interactable.c b/src/pc/djui/djui_interactable.c index b9a7232f..50efd47c 100644 --- a/src/pc/djui/djui_interactable.c +++ b/src/pc/djui/djui_interactable.c @@ -301,6 +301,18 @@ void djui_interactable_update_pad(void) { static f32 padHoldTimer = 0; enum PadHoldDirection padHoldDirection = sKeyboardHoldDirection; + // allow dpad to navigate + if (padHoldDirection == PAD_HOLD_DIR_NONE) { + if (pad->button & U_JPAD) { + padHoldDirection = PAD_HOLD_DIR_UP; + } else if (pad->button & D_JPAD) { + padHoldDirection = PAD_HOLD_DIR_DOWN; + } else if (pad->button & L_JPAD) { + padHoldDirection = PAD_HOLD_DIR_LEFT; + } else if (pad->button & R_JPAD) { + padHoldDirection = PAD_HOLD_DIR_RIGHT; + } + } if (padHoldDirection != PAD_HOLD_DIR_NONE) { switch (padHoldDirection) { case PAD_HOLD_DIR_UP: pad->stick_x = 0; pad->stick_y = -64; break;