Apply focus ui
authorhyun lee <hyunn.lee@samsung.com>
Thu, 22 Aug 2013 10:56:20 +0000 (19:56 +0900)
committerhyun lee <hyunn.lee@samsung.com>
Thu, 22 Aug 2013 10:56:20 +0000 (19:56 +0900)
Change-Id: Ib95d48a9ea71339b46cff15a3b48c634236331a2
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
CMakeLists.txt
src/controls/FWebCtrl_Web.cpp

index edbe3ef..bceda8a 100755 (executable)
@@ -117,6 +117,7 @@ TARGET_LINK_LIBRARIES(${this_target} "-losp-image" )
 TARGET_LINK_LIBRARIES(${this_target} "-losp-media" )
 TARGET_LINK_LIBRARIES(${this_target} "-losp-net" )
 TARGET_LINK_LIBRARIES(${this_target} "-lecore" )
+TARGET_LINK_LIBRARIES(${this_target} "-lecore_x" )
 TARGET_LINK_LIBRARIES(${this_target} "-lecore_imf" ) 
 TARGET_LINK_LIBRARIES(${this_target} "-lecore_imf_evas" )
 TARGET_LINK_LIBRARIES(${this_target} "-lelementary" )
index 3e084f1..b832acb 100755 (executable)
@@ -21,6 +21,7 @@
  *
  * The file contains the definition of _Web class.
  */
+#include <Ecore_X.h>
 #include <Elementary.h>
 #include <memory>
 #include <FBaseByteBuffer.h>
@@ -352,11 +353,6 @@ _Web::_Web(void)
 
 _Web::~_Web(void)
 {
-       _UiEventManager* pManager = _UiEventManager::GetInstance();
-       SysAssertf(pManager, "Failed to get ui evnet manager.");
-
-       pManager->RemoveKeyEventListener(*this);
-
        RemoveGestureListener();
 }
 
@@ -382,11 +378,6 @@ _Web::CreateWebN(void)
        r = pWeb->InitializeGestureStates();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       _UiEventManager* pManager = _UiEventManager::GetInstance();
-       SysAssertf(pManager, "Failed to get ui evnet manager.");
-
-       pManager->AddKeyEventListener(*pWeb.get());
-
        return pWeb.release();
 }
 
@@ -1181,14 +1172,22 @@ _Web::IsFocusEnd(void)
 bool
 _Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 {
-       /*
+       Ecore_X_Window rootWindow = ecore_x_window_root_first_get();
+       Ecore_X_Atom keyboardExist = ecore_x_atom_get("X External Keyboard Exist");
+       unsigned int keyboardNumber = 0;
+       int ret = ecore_x_window_prop_card32_get(rootWindow, keyboardExist, &keyboardNumber, 1);
+       if (keyboardNumber == 0)
+       {
+               return false;
+       }
+
        _KeyCode keyCode = keyInfo.GetKeyCode();
 
        if (IsFocusEnd() == true)
        {
                SetFocusEnd(false);
                evas_object_focus_set(GetWebNativeNode(), EINA_FALSE);
-               return true;
+               return false;
        }
 
        switch(keyCode)
@@ -1196,15 +1195,15 @@ _Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
        case _KEY_UP:
        case _KEY_DOWN:
                evas_object_focus_set(GetWebNativeNode(), EINA_FALSE);
-               return true;
+               return false;
                break;
        default:
                break;
        }
 
        evas_object_focus_set(GetWebNativeNode(), EINA_TRUE);
-       */
-       return false;
+
+       return true;
 }