diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 4f0afddec5..389327b3e0 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -707,21 +707,7 @@ BrowserWindow::DispatchMessage(BMessage* message, BHandler* target) if ((message->what == B_KEY_DOWN || message->what == B_UNMAPPED_KEY_DOWN) && message->FindString("bytes", &bytes) == B_OK && message->FindInt32("modifiers", &modifierKeys) == B_OK) { - modifierKeys = (int32)((uint32)modifierKeys & kModifiers); - BTextView* textView = dynamic_cast(CurrentFocus()); - if (bytes[0] == B_LEFT_ARROW && modifierKeys == B_COMMAND_KEY) { - if (textView != NULL) - textView->KeyDown(bytes, modifierKeys); - else - PostMessage(GO_BACK); - return; - } else if (bytes[0] == B_RIGHT_ARROW && modifierKeys == B_COMMAND_KEY) { - if (textView != NULL) - textView->KeyDown(bytes, modifierKeys); - else - PostMessage(GO_FORWARD); - return; - } else if (bytes[0] == B_FUNCTION_KEY) { + if (bytes[0] == B_FUNCTION_KEY) { // Some function key Firefox compatibility int32 key; if (message->FindInt32("key", &key) == B_OK) { diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index c1abc1bac8..4be291ad68 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -3803,6 +3803,17 @@ BWindow::_HandleKeyDown(BMessage* event) return true; } + // Send Command+Left and Command+Right to textview if it has focus + if (key == B_LEFT_ARROW || key == B_RIGHT_ARROW) { + // check key before doing expensive dynamic_cast + BTextView* textView = dynamic_cast(CurrentFocus()); + if (textView != NULL) { + textView->KeyDown(bytes, modifiers); + // eat the event + return true; + } + } + // Pretend that the user opened a menu, to give the subclass a // chance to update it's menus. This may install new shortcuts, // which is why we have to call it here, before trying to find