Bug 400568 - Keyboard Back/Forward keys sending VK_BROWSER_BACK/FORWARD go back/forward twice, r=emaijala, sr=ocallahan
authorHonza Bambas <honzab@allpeers.com>
Mon, 12 Jan 2009 20:17:52 +0100
changeset 23552 19757a81c07cba3e89613c2da7bbb8901da036c6
parent 23551 3066ebd9e7f9ecbf0d9749862693446db17c6435
child 23553 da0a0796090fad74500b59ffab6e8de148e5df07
push id4600
push userhonzab.moz@firemni.cz
push dateMon, 12 Jan 2009 19:22:40 +0000
treeherdermozilla-central@19757a81c07c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemaijala, ocallahan
bugs400568
milestone1.9.2a1pre
Bug 400568 - Keyboard Back/Forward keys sending VK_BROWSER_BACK/FORWARD go back/forward twice, r=emaijala, sr=ocallahan
widget/src/windows/nsWindow.cpp
old mode 100644
new mode 100755
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -3145,30 +3145,16 @@ struct nsFakeCharMessage {
 //
 //-------------------------------------------------------------------------
 LRESULT nsWindow::OnKeyDown(const MSG &aMsg,
                             PRBool *aEventDispatched,
                             nsFakeCharMessage* aFakeCharMessage)
 {
   UINT virtualKeyCode = aMsg.wParam;
 
-#ifdef VK_BROWSER_BACK
-  // VK_BROWSER_BACK and VK_BROWSER_FORWARD are converted to nsCommandEvents
-  if (virtualKeyCode == VK_BROWSER_BACK) 
-  {
-    DispatchCommandEvent(APPCOMMAND_BROWSER_BACKWARD);
-    return TRUE;
-  }
-  else if (virtualKeyCode == VK_BROWSER_FORWARD) 
-  {
-    DispatchCommandEvent(APPCOMMAND_BROWSER_FORWARD);
-    return TRUE;
-  }
-#endif
-
 #ifndef WINCE
   gKbdLayout.OnKeyDown (virtualKeyCode);
 #endif
 
   // Use only DOMKeyCode for XP processing.
   // Use aVirtualKeyCode for gKbdLayout and native processing.
   UINT DOMKeyCode = sIMEIsComposing ?
                       virtualKeyCode : MapFromNativeToDOM(virtualKeyCode);
@@ -3464,21 +3450,16 @@ LRESULT nsWindow::OnKeyDown(const MSG &a
 //-------------------------------------------------------------------------
 LRESULT nsWindow::OnKeyUp(const MSG &aMsg, PRBool *aEventDispatched)
 {
   UINT virtualKeyCode = aMsg.wParam;
 
   PR_LOG(sWindowsLog, PR_LOG_ALWAYS,
          ("nsWindow::OnKeyUp VK=%d\n", virtualKeyCode));
 
-#ifdef VK_BROWSER_BACK
-  if (virtualKeyCode == VK_BROWSER_BACK || virtualKeyCode == VK_BROWSER_FORWARD) 
-    return TRUE;
-#endif
-
   virtualKeyCode =
     sIMEIsComposing ? virtualKeyCode : MapFromNativeToDOM(virtualKeyCode);
   if (aEventDispatched)
     *aEventDispatched = PR_TRUE;
   return DispatchKeyEvent(NS_KEY_UP, 0, nsnull, virtualKeyCode, &aMsg);
 }
 
 //-------------------------------------------------------------------------