Skip to content

Commit f4090fc

Browse files
authored
Make editing the last message more consistent with the official client (#253)
1 parent 8597a31 commit f4090fc

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/resource.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,6 @@ BEGIN
14601460
"K", IDA_QUICKSWITCHER, VIRTKEY, CONTROL, NOINVERT
14611461
"F", IDA_SEARCH, VIRTKEY, CONTROL, NOINVERT
14621462
"A", IDA_SELECT_ALL, VIRTKEY, CONTROL, NOINVERT
1463-
VK_UP, IDA_EDIT_LAST_MESSAGE, VIRTKEY, NOINVERT
14641463
END
14651464

14661465

src/windows/Main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,6 +2135,19 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLin
21352135
SetFocus(msg.hwnd);
21362136
}
21372137
break;
2138+
2139+
case WM_KEYDOWN:
2140+
// Emulate a message for editing the last message to avoid
2141+
// a real accelerator capturing all up arrow input.
2142+
if (msg.wParam == VK_UP && msg.hwnd == g_pMessageEditor->m_edit_hwnd
2143+
&& GetWindowTextLength(g_pMessageEditor->m_edit_hwnd) == 0)
2144+
{
2145+
msg.hwnd = g_Hwnd;
2146+
msg.message = WM_COMMAND;
2147+
msg.lParam = 1;
2148+
msg.wParam = IDA_EDIT_LAST_MESSAGE;
2149+
}
2150+
break;
21382151
}
21392152

21402153
if (IsWindow(ProfilePopout::GetHWND()) && IsDialogMessage(ProfilePopout::GetHWND(), &msg))

0 commit comments

Comments
 (0)