From 5d472a348050f98d9d16bfc2baa2e1032064da67 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Wed, 14 Feb 2001 23:02:36 +0000 Subject: [PATCH] No bug r=mkaply, a=blizzard Handle Shift+Enter properly --- widget/src/os2/nsWindow.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index 6a929e8ae910..47ee5c01d202 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -1904,6 +1904,30 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc) result = OnPaint(); break; + case WM_TRANSLATEACCEL: + { + PQMSG pQmsg = (PQMSG)mp1; + if (pQmsg->msg == WM_CHAR) + { + LONG mp1 = (LONG)pQmsg->mp1; + LONG mp2 = (LONG)pQmsg->mp2; + + // If we have a shift+enter combination, return false + // immediately. OS/2 considers the shift+enter + // combination an accelerator and will translate it into + // a WM_OPEN message. When this happens we do not get a + // WM_CHAR for the down transition of the enter key when + // shift is also pressed and OnKeyDown will not be called. + if ( (SHORT1FROMMP(mp1) & (KC_VIRTUALKEY | KC_SHIFT)) && + (SHORT2FROMMP(mp2) == VK_ENTER) + ) + { + return(PR_TRUE); + } + } + } + break; + case WM_CHAR: result = OnKey( mp1, mp2); break;