viking

webkit based web browser for Enlightenment
Log | Files | Refs | LICENSE

commit fa19943348cf94a88774b2a7789242a070f761ec
parent d8300bd0cdec5b4305b601db6b38b0ceb3978cec
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Sat, 13 Oct 2012 22:12:54 -0600

clean up process_keypress a bit

Diffstat:
Msrc/callbacks.c | 22+++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/callbacks.c b/src/callbacks.c @@ -11,8 +11,8 @@ #include "callbacks.h" -static Eina_Bool commandhistoryfetch (const Arg *, void *); -static Eina_Bool process_keypress (void *, void*); +static Eina_Bool commandhistoryfetch(const Arg *, void *); +static Eina_Bool process_keypress(void *, Window_Data*); Eina_Bool download_gui_update(void *data); @@ -292,38 +292,26 @@ webview_mousewheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) */ Eina_Bool -process_keypress(void *event_info, void *data) +process_keypress(void *event_info, Window_Data *wd) { KeyList *walk; Key key; - // int keyval; - // GdkModifierType irrelevant; - Window_Data *wd = data; App_Data *ad = wd->app; Evas_Event_Key_Down *ev = event_info; - // Get a mask of modifiers that shouldn't be considered for this event. - // E.g.: It shouldn't matter whether ';' is shifted or not. - // gdk_keymap_translate_keyboard_state(keymap, event->hardware_keycode, - // event->state, event->group, &keyval, NULL, NULL, &irrelevant); - - //if (elm_object_focus_get(wd->url)) - // return EINA_FALSE; - walk = ad->keylistroot; while (walk != NULL) { key = walk->Element; - // if (current->Element.mask == (CLEAN(event->state) & ~irrelevant) if ((key.mask == 0 || evas_key_modifier_is_set(ev->modifiers, key.mask)) && (key.modkey == wd->current_modkey || (!key.modkey && !wd->current_modkey) || key.modkey == '*' ) // wildcard && !strcmp(key.key, ev->key) && key.func) - if (key.func(&key.arg, data)) { + if (key.func(&key.arg, wd)) { // printf("process_keypress() function for mask = %s modkey = %c key = %s called.\n", key.mask, ad->current_modkey, key.key); wd->current_modkey = wd->count = 0; - update_state(data); + update_state(wd); return EINA_TRUE; } walk = walk->next;