"event.ctrlKey" is always false when dragging an element with "ctrl" key down
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 14 Mar 2010 15:43:52 +0000 (15:43 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 14 Mar 2010 15:43:52 +0000 (15:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=17113

Reviewed by Sam Weinig.

No new tests.

* page/DragController.cpp:
(WebCore::createMouseEvent):
Use the current state of the shift, ctrl, alt, and meta keys when creating the drag mouse event.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55974 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/DragController.cpp

index 9e398e7..9cc89b4 100644 (file)
@@ -1,3 +1,16 @@
+2010-03-14  Jessie Berlin  <jberlin@webkit.org>
+
+        Reviewed by Sam Weinig.
+
+        "event.ctrlKey" is always false when dragging an element with "ctrl" key down
+        https://bugs.webkit.org/show_bug.cgi?id=17113
+
+        No new tests.
+
+        * page/DragController.cpp:
+        (WebCore::createMouseEvent):
+        Use the current state of the shift, ctrl, alt, and meta keys when creating the drag mouse event.
+
 2010-03-13  Antonio Gomes  <tonikitoo@webkit.org>
 
         Not reviewed identation fix.
index 06d3649..c19e349 100644 (file)
@@ -53,6 +53,7 @@
 #include "MoveSelectionCommand.h"
 #include "Node.h"
 #include "Page.h"
+#include "PlatformKeyboardEvent.h"
 #include "RenderFileUploadControl.h"
 #include "RenderImage.h"
 #include "RenderView.h"
@@ -70,10 +71,12 @@ namespace WebCore {
 
 static PlatformMouseEvent createMouseEvent(DragData* dragData)
 {
-    // FIXME: We should fake modifier keys here.
+    bool shiftKey, ctrlKey, altKey, metaKey;
+    shiftKey = ctrlKey = altKey = metaKey = false;
+    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
     return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPosition(),
-                              LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime());
-
+                              LeftButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey,
+                              metaKey, currentTime());
 }
 
 DragController::DragController(Page* page, DragClient* client)