[haiku-webkit-commits] r262 - in webkit/trunk/WebKit/haiku: API WebCoreSupport

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Tue, 02 Mar 2010 00:30:37 +0000

Author: stippi
Date: Tue Mar  2 00:30:37 2010
New Revision: 262
URL: http://mmlr.dyndns.org/changeset/262

Log:
* Only handle B_KEY_DOWN events in BWebPage. This makes repeat work properly.
* Don't implement the events in EditorClientHaiku, which don't work. On second
  thought, we could probably just do what BWebPage now does. Shouldn't matter
  much in any case.

These changes prevent the BWebPage keyboard handling to interfere with text
editing.

Modified:
   webkit/trunk/WebKit/haiku/API/WebPage.cpp
   webkit/trunk/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp

Modified: webkit/trunk/WebKit/haiku/API/WebPage.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.cpp   Mon Mar  1 19:15:07 2010        
(r261)
+++ webkit/trunk/WebKit/haiku/API/WebPage.cpp   Tue Mar  2 00:30:37 2010        
(r262)
@@ -833,7 +833,7 @@
 
     PlatformKeyboardEvent event(message);
        // Try to let WebCore handle this event
-       if (!frame->eventHandler()->keyEvent(event)) {
+       if (!frame->eventHandler()->keyEvent(event) && message->what == 
B_KEY_DOWN) {
                // Handle keyboard scrolling (probably should be extracted to a 
method.)
                ScrollDirection direction;
                ScrollGranularity granularity;

Modified: webkit/trunk/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp      Mon Mar 
 1 19:15:07 2010        (r261)
+++ webkit/trunk/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp      Tue Mar 
 2 00:30:37 2010        (r262)
@@ -383,6 +383,8 @@
 
 #if 1
     switch (platformEvent->windowsVirtualKeyCode()) {
+#if 0
+// Handled in upper layer
     case VK_UP:
         frame->editor()->command("MoveUp").execute();
         break;
@@ -395,15 +397,19 @@
     case VK_NEXT:  // PageDown
         frame->editor()->command("MoveDownByPageAndModifyCaret").execute();
         break;
+#endif
     default:
         if (platformEvent->ctrlKey()) {
                switch (platformEvent->windowsVirtualKeyCode()) {
+#if 0
+// Handled in upper layer
                    case VK_HOME:
                        
frame->editor()->command("MoveToBeginningOfDocument").execute();
                        break;
                    case VK_END:
                 frame->editor()->command("MoveToEndOfDocument").execute();
                        break;
+#endif
                    case VK_A:
                    frame->editor()->command("SelectAll").execute();
                        break;

Other related posts: