Apply focus ui, fix for issue
[framework/osp/web.git] / src / controls / FWebCtrl_Web.cpp
index 09b71aa..802f9ff 100755 (executable)
@@ -341,6 +341,7 @@ _Web::_Web(void)
        , __pPinchGestureHandler(null)
        , __gestureType(WEB_GESTURE_TYPE_TAP)
        , __edgeType(WEB_EDGE_NONE)
+       , __focus(false)
        , __pTextElement(null)
        , __previousTouchedPosition(0.0f, 0.0f)
        , __isFullScreenEntered(false)
@@ -1163,6 +1164,49 @@ _Web::SetFullScreenEntered(bool isFullScreenEntered)
 }
 
 
+void
+_Web::SetFocusEnd(bool focus)
+{
+       __focus = focus;
+}
+
+
+bool
+_Web::IsFocusEnd(void)
+{
+       return __focus;
+}
+
+
+bool
+_Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (IsFocusEnd() == true)
+       {
+               SetFocusEnd(false);
+               evas_object_focus_set(GetWebNativeNode(), EINA_FALSE);
+               return false;
+       }
+
+       switch(keyCode)
+       {
+       case _KEY_UP:
+       case _KEY_DOWN:
+               evas_object_focus_set(GetWebNativeNode(), EINA_FALSE);
+               return false;
+               break;
+       default:
+               break;
+       }
+
+       evas_object_focus_set(GetWebNativeNode(), EINA_TRUE);
+
+       return true;
+}
+
+
 bool
 _Web::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
 {
@@ -1182,4 +1226,10 @@ _Web::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
 }
 
 
+void
+_Web::OnDrawFocus(void)
+{
+}
+
+
 }}} // Tizen::Web::Controls