Hi, all.
This patch makes elementary widgets be able to handle the event of keypad.
Thanks.
Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c (revision 55046)
+++ src/lib/elm_genlist.c (working copy)
@@ -487,35 +487,41 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
else
y += step_y;
}
- else if (!strcmp(ev->keyname, "Home"))
+ else if ((!strcmp(ev->keyname, "Home")) ||
+ (!strcmp(ev->keyname, "KP_Home")))
{
it = elm_genlist_first_item_get(obj);
elm_genlist_item_bring_in(it);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- else if (!strcmp(ev->keyname, "End"))
+ else if ((!strcmp(ev->keyname, "End")) ||
+ (!strcmp(ev->keyname, "KP_End")))
{
it = elm_genlist_last_item_get(obj);
elm_genlist_item_bring_in(it);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- else if (!strcmp(ev->keyname, "Prior"))
+ else if ((!strcmp(ev->keyname, "Prior")) ||
+ (!strcmp(ev->keyname, "KP_Prior")))
{
if (page_y < 0)
y -= -(page_y * v_h) / 100;
else
y -= page_y;
}
- else if (!strcmp(ev->keyname, "Next"))
+ else if ((!strcmp(ev->keyname, "Next")) ||
+ (!strcmp(ev->keyname, "KP_Next")))
{
if (page_y < 0)
y += -(page_y * v_h) / 100;
else
y += page_y;
}
- else if(((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname,
"space")))
+ else if(((!strcmp(ev->keyname, "Return")) ||
+ (!strcmp(ev->keyname, "KP_Enter")) ||
+ (!strcmp(ev->keyname, "space")))
&& (!wd->multi) && (wd->selected))
{
Elm_Genlist_Item *it = elm_genlist_selected_item_get(obj);
Index: src/lib/elm_list.c
===================================================================
--- src/lib/elm_list.c (revision 55046)
+++ src/lib/elm_list.c (working copy)
@@ -149,7 +149,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
/* TODO: fix logic for horizontal mode */
- if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
+ if ((!strcmp(ev->keyname, "Left")) ||
+ (!strcmp(ev->keyname, "KP_Left")))
{
if ((wd->h_mode) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -162,7 +163,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
else
x -= step_x;
}
- else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname,
"KP_Right")))
+ else if ((!strcmp(ev->keyname, "Right")) ||
+ (!strcmp(ev->keyname, "KP_Right")))
{
if ((wd->h_mode) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -175,7 +177,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
else
x += step_x;
}
- else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
+ else if ((!strcmp(ev->keyname, "Up")) ||
+ (!strcmp(ev->keyname, "KP_Up")))
{
if ((!wd->h_mode) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -188,7 +191,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
else
y -= step_y;
}
- else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname,
"KP_Down")))
+ else if ((!strcmp(ev->keyname, "Down")) ||
+ (!strcmp(ev->keyname, "KP_Down")))
{
if ((!wd->h_mode) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -201,21 +205,24 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
else
y += step_y;
}
- else if (!strcmp(ev->keyname, "Home"))
+ else if ((!strcmp(ev->keyname, "Home")) ||
+ (!strcmp(ev->keyname, "KP_Home")))
{
it = eina_list_data_get(wd->items);
elm_list_item_bring_in(it);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- else if (!strcmp(ev->keyname, "End"))
+ else if ((!strcmp(ev->keyname, "End")) ||
+ (!strcmp(ev->keyname, "KP_End")))
{
it = eina_list_data_get(eina_list_last(wd->items));
elm_list_item_bring_in(it);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- else if (!strcmp(ev->keyname, "Prior"))
+ else if ((!strcmp(ev->keyname, "Prior")) ||
+ (!strcmp(ev->keyname, "KP_Prior")))
{
if (wd->h_mode)
{
@@ -232,7 +239,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
y -= page_y;
}
}
- else if (!strcmp(ev->keyname, "Next"))
+ else if ((!strcmp(ev->keyname, "Next")) ||
+ (!strcmp(ev->keyname, "KP_Next")))
{
if (wd->h_mode)
{
Index: src/lib/elm_gengrid.c
===================================================================
--- src/lib/elm_gengrid.c (revision 55046)
+++ src/lib/elm_gengrid.c (working copy)
@@ -354,21 +354,21 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
else
y += step_y;
}
- else if (!strcmp(ev->keyname, "Home"))
+ else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname,
"KP_Home")))
{
item = elm_gengrid_first_item_get(obj);
elm_gengrid_item_bring_in(item);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- else if (!strcmp(ev->keyname, "End"))
+ else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
{
item = elm_gengrid_last_item_get(obj);
elm_gengrid_item_bring_in(item);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- else if (!strcmp(ev->keyname, "Prior"))
+ else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname,
"KP_Prior")))
{
if (wd->horizontal)
{
@@ -385,7 +385,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
y -= page_y;
}
}
- else if (!strcmp(ev->keyname, "Next"))
+ else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname,
"KP_Next")))
{
if (wd->horizontal)
{
Index: src/lib/elm_radio.c
===================================================================
--- src/lib/elm_radio.c (revision 55046)
+++ src/lib/elm_radio.c (working copy)
@@ -78,7 +78,10 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
Evas_Event_Key_Down *ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space")))
+
+ if ((strcmp(ev->keyname, "Return")) &&
+ (strcmp(ev->keyname, "KP_Enter")) &&
+ (strcmp(ev->keyname, "space")))
return EINA_FALSE;
_activate(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
Index: src/lib/elm_calendar.c
===================================================================
--- src/lib/elm_calendar.c (revision 55046)
+++ src/lib/elm_calendar.c (working copy)
@@ -572,7 +572,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
if (!wd->selection_enabled) return EINA_FALSE;
- if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
+ if ((!strcmp(ev->keyname, "Left")) ||
+ (!strcmp(ev->keyname, "KP_Left")))
{
_update_sel_it(obj, wd->selected_it-1);
}
@@ -581,11 +582,13 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
{
_update_sel_it(obj, wd->selected_it+1);
}
- else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
+ else if ((!strcmp(ev->keyname, "Up")) ||
+ (!strcmp(ev->keyname, "KP_Up")))
{
_update_sel_it(obj, wd->selected_it-7);
}
- else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname,
"KP_Down")))
+ else if ((!strcmp(ev->keyname, "Down")) ||
+ (!strcmp(ev->keyname, "KP_Down")))
{
_update_sel_it(obj, wd->selected_it+7);
}
@@ -594,7 +597,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
{
if (_update_month(obj, -1)) _populate(obj);
}
- else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname,
"KP_Next")))
+ else if ((!strcmp(ev->keyname, "Next")) ||
+ (!strcmp(ev->keyname, "KP_Next")))
{
if (_update_month(obj, 1)) _populate(obj);
}
Index: src/lib/elm_button.c
===================================================================
--- src/lib/elm_button.c (revision 55046)
+++ src/lib/elm_button.c (working copy)
@@ -56,7 +56,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
if (!wd) return EINA_FALSE;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space")))
+ if ((strcmp(ev->keyname, "Return")) &&
+ (strcmp(ev->keyname, "KP_Enter")) &&
+ (strcmp(ev->keyname, "space")))
return EINA_FALSE;
_activate(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
Index: src/lib/elm_diskselector.c
===================================================================
--- src/lib/elm_diskselector.c (revision 55046)
+++ src/lib/elm_diskselector.c (working copy)
@@ -329,9 +329,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
if ((!l) && (wd->round))
l = wd->items;
}
- else if (!strcmp(ev->keyname, "Home"))
+ else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname,
"KP_Home")))
l = wd->items;
- else if (!strcmp(ev->keyname, "End"))
+ else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
l = eina_list_last(wd->items);
else return EINA_FALSE;
Index: src/lib/elm_toggle.c
===================================================================
--- src/lib/elm_toggle.c (revision 55046)
+++ src/lib/elm_toggle.c (working copy)
@@ -54,7 +54,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
if (!wd) return EINA_FALSE;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space")))
+ if ((strcmp(ev->keyname, "Return")) &&
+ (strcmp(ev->keyname, "KP_Enter")) &&
+ (strcmp(ev->keyname, "space")))
return EINA_FALSE;
elm_toggle_state_set(obj, !wd->state);
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
Index: src/lib/elm_scroller.c
===================================================================
--- src/lib/elm_scroller.c (revision 55046)
+++ src/lib/elm_scroller.c (working copy)
@@ -119,22 +119,22 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
{
y += step_y;
}
- else if (!strcmp(ev->keyname, "Home"))
+ else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname,
"KP_Home")))
{
y = 0;
}
- else if (!strcmp(ev->keyname, "End"))
+ else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
{
y = max_y - v_h;
}
- else if (!strcmp(ev->keyname, "Prior"))
+ else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname,
"KP_Prior")))
{
if (page_y < 0)
y -= -(page_y * v_h) / 100;
else
y -= page_y;
}
- else if (!strcmp(ev->keyname, "Next"))
+ else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname,
"KP_Next")))
{
if (page_y < 0)
y += -(page_y * v_h) / 100;
Index: src/lib/elm_panel.c
===================================================================
--- src/lib/elm_panel.c (revision 55046)
+++ src/lib/elm_panel.c (working copy)
@@ -212,7 +212,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space")))
+ if ((strcmp(ev->keyname, "Return")) &&
+ (strcmp(ev->keyname, "KP_Enter")) &&
+ (strcmp(ev->keyname, "space")))
return EINA_FALSE;
_toggle_panel(obj, NULL, "elm,action,panel,toggle", "*");
Index: src/lib/elm_slideshow.c
===================================================================
--- src/lib/elm_slideshow.c (revision 55046)
+++ src/lib/elm_slideshow.c (working copy)
@@ -81,7 +81,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
- if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "space")))
+ if ((!strcmp(ev->keyname, "Return")) ||
+ (!strcmp(ev->keyname, "KP_Enter")) ||
+ (!strcmp(ev->keyname, "space")))
{
if (wd->timeout)
elm_slideshow_timeout_set(obj, 0);
Index: src/lib/elm_check.c
===================================================================
--- src/lib/elm_check.c (revision 55046)
+++ src/lib/elm_check.c (working copy)
@@ -58,7 +58,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
Evas_Event_Key_Down *ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space")))
+ if ((strcmp(ev->keyname, "Return")) &&
+ (strcmp(ev->keyname, "KP_Enter")) &&
+ (strcmp(ev->keyname, "space")))
return EINA_FALSE;
_activate(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel