[chromium] No modifier flags (shift/ctrl/alt) in drag&drop events on chromium linux
[WebKit-https.git] / Source / WebCore / platform / DragData.cpp
index a61feab5ab3c0f902a858fa471bc70b190ea4f7f..efb705a46b524c04efe5e41ab4cf10eb7e4a1d4b 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "config.h"
 #include "DragData.h"
 
 #include "config.h"
 #include "DragData.h"
+#include "PlatformEvent.h"
+#include "PlatformKeyboardEvent.h"
 
 #if ENABLE(DRAG_SUPPORT)
 namespace WebCore {
 
 #if ENABLE(DRAG_SUPPORT)
 namespace WebCore {
@@ -51,6 +53,26 @@ DragData::DragData(const String&, const IntPoint& clientPosition, const IntPoint
 }
 #endif
 
 }
 #endif
 
+#if !PLATFORM(CHROMIUM)
+int DragData::modifierKeyState() const
+{
+    bool shiftKey, ctrlKey, altKey, metaKey;
+    shiftKey = ctrlKey = altKey = metaKey = false;
+    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
+    int keyState = 0;
+    if (shiftKey)
+        keyState = keyState | PlatformEvent::ShiftKey;
+    if (ctrlKey)
+        keyState = keyState | PlatformEvent::CtrlKey;
+    if (altKey)
+        keyState = keyState | PlatformEvent::AltKey;
+    if (metaKey)
+        keyState = keyState | PlatformEvent::MetaKey;
+    return keyState;
+}
+#endif
+
+
 } // namespace WebCore
 
 #endif // ENABLE(DRAG_SUPPORT)
 } // namespace WebCore
 
 #endif // ENABLE(DRAG_SUPPORT)