diff --git a/legacy/ecore/src/lib/ecore_input/Ecore_Input.h b/legacy/ecore/src/lib/ecore_input/Ecore_Input.h index 7efc8dcf25..62b7e5fd56 100644 --- a/legacy/ecore/src/lib/ecore_input/Ecore_Input.h +++ b/legacy/ecore/src/lib/ecore_input/Ecore_Input.h @@ -193,6 +193,9 @@ struct _Ecore_Event_Modifiers EAPI int ecore_event_init(void); EAPI int ecore_event_shutdown(void); +EAPI unsigned int ecore_event_modifier_mask(Ecore_Event_Modifier modifier); +EAPI Ecore_Event_Modifier ecore_event_update_modifier(const char *key, Ecore_Event_Modifiers *modifiers, int inc); + #ifdef __cplusplus } #endif diff --git a/legacy/ecore/src/lib/ecore_input_evas/ecore_input_evas.c b/legacy/ecore/src/lib/ecore_input_evas/ecore_input_evas.c index efe74c6aa7..9221877473 100644 --- a/legacy/ecore/src/lib/ecore_input_evas/ecore_input_evas.c +++ b/legacy/ecore/src/lib/ecore_input_evas/ecore_input_evas.c @@ -336,51 +336,3 @@ ecore_event_evas_shutdown(void) return _ecore_event_evas_init_count; } -typedef struct _Ecore_Event_Modifier_Match Ecore_Event_Modifier_Match; -struct _Ecore_Event_Modifier_Match -{ - const char *key; - Ecore_Event_Modifier modifier; - unsigned int event_modifier; -}; - -static const Ecore_Event_Modifier_Match matchs[] = { - { "Shift_L", ECORE_SHIFT, ECORE_EVENT_MODIFIER_SHIFT }, - { "Shift_R", ECORE_SHIFT, ECORE_EVENT_MODIFIER_SHIFT }, - { "Alt_L", ECORE_ALT, ECORE_EVENT_MODIFIER_ALT }, - { "Alt_R", ECORE_ALT, ECORE_EVENT_MODIFIER_ALT }, - { "Control_L", ECORE_CTRL, ECORE_EVENT_MODIFIER_CTRL }, - { "Control_R", ECORE_CTRL, ECORE_EVENT_MODIFIER_CTRL }, - { "Caps_Lock", ECORE_CAPS, ECORE_EVENT_MODIFIER_CAPS }, - { "Super_L", ECORE_WIN, ECORE_EVENT_MODIFIER_WIN }, - { "Super_R", ECORE_WIN, ECORE_EVENT_MODIFIER_WIN }, - { "Scroll_Lock", ECORE_SCROLL, ECORE_EVENT_MODIFIER_SCROLL } -}; - -EAPI unsigned int -ecore_event_modifier_mask(Ecore_Event_Modifier modifier) -{ - int i; - - for (i = 0; i < sizeof (matchs) / sizeof (Ecore_Event_Modifier_Match); i++) - if (matchs[i].modifier == modifier) - return matchs[i].event_modifier; - - return 0; -} - -EAPI Ecore_Event_Modifier -ecore_event_update_modifier(const char *key, Ecore_Event_Modifiers *modifiers, int inc) -{ - int i; - - for (i = 0; i < sizeof (matchs) / sizeof (Ecore_Event_Modifier_Match); i++) - if (strcmp(matchs[i].key, key) == 0) - { - if (modifiers && matchs[i].modifier < modifiers->size) - modifiers->array[matchs[i].modifier] += inc; - return matchs[i].modifier; - } - - return ECORE_NONE; -}