summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/default/base.src77
-rw-r--r--config/mobile/base.src77
-rw-r--r--config/standard/base.src77
-rw-r--r--src/lib/elc_popup.c68
4 files changed, 263 insertions, 36 deletions
diff --git a/config/default/base.src b/config/default/base.src
index dad2675d8..f3729f457 100644
--- a/config/default/base.src
+++ b/config/default/base.src
@@ -325,6 +325,83 @@ group "Elm_Config" struct {
}
}
group "Elm_Config_Bindings_Widget" struct {
+ value "name" string: "Elc_Popup";
+ group "key_bindings" list {
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Tap";
+ value "action" string: "move";
+ value "params" string: "previous";
+ group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+ value "mod" string: "Shift";
+ value "flag" uchar: 1;
+ }
+ }
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Tap";
+ value "action" string: "move";
+ value "params" string: "next";
+ group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+ value "mod" string: "Shift";
+ value "flag" uchar: 0;
+ }
+ }
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Left";
+ value "action" string: "move";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Left";
+ value "action" string: "move";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Right";
+ value "action" string: "move";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Right";
+ value "action" string: "move";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Up";
+ value "action" string: "move";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Up";
+ value "action" string: "move";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Down";
+ value "action" string: "move";
+ value "params" string: "down";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Down";
+ value "action" string: "move";
+ value "params" string: "down";
+ }
+ }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
value "name" string: "Elm_Button";
group "key_bindings" list {
group "Elm_Config_Binding_Key" struct {
diff --git a/config/mobile/base.src b/config/mobile/base.src
index 76226d6c3..b3c7c624f 100644
--- a/config/mobile/base.src
+++ b/config/mobile/base.src
@@ -329,6 +329,83 @@ group "Elm_Config" struct {
}
}
group "Elm_Config_Bindings_Widget" struct {
+ value "name" string: "Elc_Popup";
+ group "key_bindings" list {
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Tap";
+ value "action" string: "move";
+ value "params" string: "previous";
+ group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+ value "mod" string: "Shift";
+ value "flag" uchar: 1;
+ }
+ }
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Tap";
+ value "action" string: "move";
+ value "params" string: "next";
+ group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+ value "mod" string: "Shift";
+ value "flag" uchar: 0;
+ }
+ }
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Left";
+ value "action" string: "move";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Left";
+ value "action" string: "move";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Right";
+ value "action" string: "move";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Right";
+ value "action" string: "move";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Up";
+ value "action" string: "move";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Up";
+ value "action" string: "move";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Down";
+ value "action" string: "move";
+ value "params" string: "down";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Down";
+ value "action" string: "move";
+ value "params" string: "down";
+ }
+ }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
value "name" string: "Elm_Button";
group "key_bindings" list {
group "Elm_Config_Binding_Key" struct {
diff --git a/config/standard/base.src b/config/standard/base.src
index 7c0a1a095..0c7d55e2e 100644
--- a/config/standard/base.src
+++ b/config/standard/base.src
@@ -326,6 +326,83 @@ group "Elm_Config" struct {
}
}
group "Elm_Config_Bindings_Widget" struct {
+ value "name" string: "Elc_Popup";
+ group "key_bindings" list {
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Tap";
+ value "action" string: "move";
+ value "params" string: "previous";
+ group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+ value "mod" string: "Shift";
+ value "flag" uchar: 1;
+ }
+ }
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Tap";
+ value "action" string: "move";
+ value "params" string: "next";
+ group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+ value "mod" string: "Shift";
+ value "flag" uchar: 0;
+ }
+ }
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Left";
+ value "action" string: "move";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Left";
+ value "action" string: "move";
+ value "params" string: "left";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Right";
+ value "action" string: "move";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Right";
+ value "action" string: "move";
+ value "params" string: "right";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Up";
+ value "action" string: "move";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Up";
+ value "action" string: "move";
+ value "params" string: "up";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "Down";
+ value "action" string: "move";
+ value "params" string: "down";
+ }
+ group "Elm_Config_Binding_Key" struct {
+ value "context" int: 0;
+ value "key" string: "KP_Down";
+ value "action" string: "move";
+ value "params" string: "down";
+ }
+ }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
value "name" string: "Elm_Button";
group "key_bindings" list {
group "Elm_Config_Binding_Key" struct {
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index bbe861c10..9e142cbb0 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -36,6 +36,13 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
+static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
+
+static const Elm_Action key_actions[] = {
+ {"move", _key_action_move},
+ {NULL, NULL}
+};
+
static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
EOLIAN static Eina_Bool
@@ -1431,6 +1438,29 @@ _elc_popup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elc_Popup_Data *sd, c
return EINA_TRUE;
}
+static Eina_Bool
+_key_action_move(Evas_Object *obj, const char *params)
+{
+ const char *dir = params;
+
+ if (!strcmp(dir, "previous"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
+ else if (!strcmp(dir, "next"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
+ else if (!strcmp(dir, "left"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
+ else if (!strcmp(dir, "right"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
+ else if (!strcmp(dir, "up"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
+ else if (!strcmp(dir, "down"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
+ else return EINA_FALSE;
+
+ return EINA_TRUE;
+
+}
+
EOLIAN static Eina_Bool
_elc_popup_elm_widget_event(Eo *obj, Elc_Popup_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
{
@@ -1441,43 +1471,9 @@ _elc_popup_elm_widget_event(Eo *obj, Elc_Popup_Data *_pd EINA_UNUSED, Evas_Objec
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (!strcmp(ev->key, "Tab"))
- {
- if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
- elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
- else
- elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
-
- goto success;
- }
- else if ((!strcmp(ev->key, "Left")) ||
- ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
- {
- elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
- goto success;
- }
- else if ((!strcmp(ev->key, "Right")) ||
- ((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
- {
- elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
- goto success;
- }
- else if ((!strcmp(ev->key, "Up")) ||
- ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
- {
- elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
- goto success;
- }
- else if ((!strcmp(ev->key, "Down")) ||
- ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
- {
- elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
- goto success;
- }
-
- return EINA_FALSE;
+ if (!_elm_config_key_binding_call(obj, ev, key_actions))
+ return EINA_FALSE;
-success:
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}