From 8ab9f296560e73527ce6c1ab442e84de3f86e08e Mon Sep 17 00:00:00 2001 From: TomGoodIdea Date: Sat, 4 Apr 2026 11:59:52 +0200 Subject: [PATCH] Make editing the last message more consistent with the official client --- src/resource.rc | 1 - src/windows/Main.cpp | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/resource.rc b/src/resource.rc index 3dbbaa0..cd3f7e7 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -1460,7 +1460,6 @@ BEGIN "K", IDA_QUICKSWITCHER, VIRTKEY, CONTROL, NOINVERT "F", IDA_SEARCH, VIRTKEY, CONTROL, NOINVERT "A", IDA_SELECT_ALL, VIRTKEY, CONTROL, NOINVERT - VK_UP, IDA_EDIT_LAST_MESSAGE, VIRTKEY, NOINVERT END diff --git a/src/windows/Main.cpp b/src/windows/Main.cpp index cc752d2..fc97f60 100644 --- a/src/windows/Main.cpp +++ b/src/windows/Main.cpp @@ -2135,6 +2135,19 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLin SetFocus(msg.hwnd); } break; + + case WM_KEYDOWN: + // Emulate a message for editing the last message to avoid + // a real accelerator capturing all up arrow input. + if (msg.wParam == VK_UP && msg.hwnd == g_pMessageEditor->m_edit_hwnd + && GetWindowTextLength(g_pMessageEditor->m_edit_hwnd) == 0) + { + msg.hwnd = g_Hwnd; + msg.message = WM_COMMAND; + msg.lParam = 1; + msg.wParam = IDA_EDIT_LAST_MESSAGE; + } + break; } if (IsWindow(ProfilePopout::GetHWND()) && IsDialogMessage(ProfilePopout::GetHWND(), &msg))