[haiku-webkit-commits] r408 - webkit/trunk/WebKit/haiku/WebPositive

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Apr 2010 17:44:22 +0000

Author: stippi
Date: Mon Apr 12 17:44:22 2010
New Revision: 408
URL: http://mmlr.dyndns.org/changeset/408

Log:
Fix the cmd-arrow left/right for go back/forward actions. Truncate the modifiers
to just the part that describes the modifier keys in general. What's left should
be exactly B_COMMAND_KEY. This fixes the workspace switching short-cut to 
trigger
page history navigation WebPositive.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Mon Apr 12 
16:57:03 2010        (r407)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Mon Apr 12 
17:44:22 2010        (r408)
@@ -366,15 +366,21 @@
 BrowserWindow::DispatchMessage(BMessage* message, BHandler* target)
 {
        const char* bytes;
-       int32 modifiers;
+       uint32 modifiers;
        if ((message->what == B_KEY_DOWN || message->what == 
B_UNMAPPED_KEY_DOWN)
                && message->FindString("bytes", &bytes) == B_OK
-               && message->FindInt32("modifiers", &modifiers) == B_OK) {
-               if (target == fURLInputGroup->TextView()) {
+               && message->FindInt32("modifiers", (int32*)&modifiers) == B_OK) 
{
+
+               modifiers = modifiers & 0x000000ff;
+               if (bytes[0] == B_LEFT_ARROW && modifiers == B_COMMAND_KEY)
+                       PostMessage(GO_BACK);
+               else if (bytes[0] == B_RIGHT_ARROW && modifiers == 
B_COMMAND_KEY)
+                       PostMessage(GO_FORWARD);
+               else if (target == fURLInputGroup->TextView()) {
                        // Handle B_RETURN in the URL text control. This is the 
easiest
                        // way to react *only* when the user presses the return 
key in the
-                       // address bar, as opposed to trying to load whatever 
is in there when
-                       // the text control just goes out of focus.
+                       // address bar, as opposed to trying to load whatever 
is in there
+                       // when the text control just goes out of focus.
                        if (bytes[0] == B_RETURN) {
                                // Do it in such a way that the user sees the 
Go-button go down.
                                
fURLInputGroup->GoButton()->SetValue(B_CONTROL_ON);
@@ -383,10 +389,6 @@
                                snooze(1000);
                                
fURLInputGroup->GoButton()->SetValue(B_CONTROL_OFF);
                        }
-               } else if (bytes[0] == B_LEFT_ARROW && (modifiers & 
B_COMMAND_KEY) != 0) {
-                       PostMessage(GO_BACK);
-               } else if (bytes[0] == B_RIGHT_ARROW && (modifiers & 
B_COMMAND_KEY) != 0) {
-                       PostMessage(GO_FORWARD);
                }
        }
        BWebWindow::DispatchMessage(message, target);

Other related posts:

  • » [haiku-webkit-commits] r408 - webkit/trunk/WebKit/haiku/WebPositive - webkit