From 170e048f4ceb11633b62cfcc5b82df6a5aa9c27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 2 Mar 2022 21:55:57 +0100 Subject: Open episode on Enter, but in a better way. --- c/listview.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'c/listview.c') diff --git a/c/listview.c b/c/listview.c index 3025297..2c24048 100644 --- a/c/listview.c +++ b/c/listview.c @@ -47,18 +47,23 @@ LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } break; - case WM_GETDLGCODE: /* Open episode on Enter. */ + case WM_GETDLGCODE: { LRESULT lResult; extern HWND HElv; extern LPLVITEM LpLviElvSelection; + + /* For the episode list view, the Enter key should not + * be handled by the dialog manager, but instead be sent + * along to the main window procedure, so that it may be + * handled by the NM_RETURN case in ElvHandleNotify. + */ + if (hLv != HElv) break; lResult = CallWindowProc(LvPrevProc, hLv, uMsg, wParam, lParam); if (lParam && ((MSG *)lParam)->message == WM_KEYDOWN - && ((MSG *)lParam)->wParam == VK_RETURN) { - lResult &= ~DLGC_WANTMESSAGE; - ElvEnter(LpLviElvSelection); - } + && ((MSG *)lParam)->wParam == VK_RETURN) + return DLGC_WANTMESSAGE; return lResult; } } -- cgit v1.2.3