[EFL][WK2] Add support for IMF composition
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebCoreSupport / efl / WebEditorClientEfl.cpp
index 22a5cf4..8dc90d0 100644 (file)
 #include "WebEditorClient.h"
 
 #include "Frame.h"
+#include "NativeWebKeyboardEvent.h"
 #include "PlatformKeyboardEvent.h"
 #include "WebPage.h"
 #include "WebPageProxyMessages.h"
 #include "WebProcess.h"
+#include <WebCore/FocusController.h>
 #include <WebCore/KeyboardEvent.h>
 #include <WebCore/NotImplemented.h>
+#include <WebCore/Page.h>
 
 using namespace WebCore;
 
@@ -44,9 +47,18 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event)
         event->setDefaultHandled();
 }
 
-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent*)
+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event)
 {
-    notImplemented();
+    Frame* frame = m_page->corePage()->focusController()->focusedOrMainFrame();
+    if (!frame || !frame->editor()->canEdit())
+        return;
+
+    // FIXME: sending sync message might make input lagging.
+    bool handled = false;
+    m_page->sendSync(Messages::WebPageProxy::HandleInputMethodKeydown(), Messages::WebPageProxy::HandleInputMethodKeydown::Reply(handled));
+
+    if (handled)
+        event->setDefaultHandled();
 }
 
 }