diff --git a/src/pc/djui/djui_interactable.c b/src/pc/djui/djui_interactable.c index 6c794d257..31a378239 100644 --- a/src/pc/djui/djui_interactable.c +++ b/src/pc/djui/djui_interactable.c @@ -211,12 +211,6 @@ bool djui_interactable_on_key_down(int scancode) { } } - if (scancode == SCANCODE_ESCAPE && djui_panel_is_active()) { - // pressed escape button on keyboard - djui_panel_back(); - return true; - } - if (gDjuiChatBox != NULL && !gDjuiChatBoxFocus) { bool pressChat = false; for (int i = 0; i < MAX_BINDS; i++) { @@ -289,6 +283,12 @@ void djui_interactable_on_key_up(int scancode) { } } + if (scancode == SCANCODE_ESCAPE && djui_panel_is_active()) { + // pressed escape button on keyboard + djui_panel_back(); + return; + } + if (gDjuiPlayerList != NULL || gDjuiModList != NULL) { for (int i = 0; i < MAX_BINDS; i++) { if (scancode == (int)configKeyPlayerList[i]) {