Hello!
If I try to make a Enlightenment conform solution for key binding, you
can approve it?
Bye
Godzzo
Carsten Haitzler (The Rasterman) wrote:
>On Tue, 19 Apr 2005 19:55:20 +0200 "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>babbled:
>
>
>
>>Hello!
>>
>>I would like to create some key handling code for enlightenment wm
>> (I would like to use it, hence I need hot key)s.
>>I created some test codes in e_border.c.
>>I will put the XGrabKey codes to ecore_x.c, and I have to analyze, how can
>> catch the keys in desktop (I only can at now the window keys).
>>
>>
>
>yes - it needs to go there. we cant go putting random x code in e17 (well we
>CAN but its not the right place). also the keybindings need to work off
>configuration and generic actions - like the button bindings do now. also to
>do bindings right - look at the "old" ecore code in ecore/src/e_x.c and
>ecore/src/e_ev_x.c
>
>also can you attach patches - they can't be applied if inline because of
>linewrapping :(
>
>unfortunately as it stands we can't really use this patch :/
>
>
>
>>sorry for my english!
>>
>>
>
>that's ok - it's better than my hungarian! :)
>
>
>
>>Bye
>> Godzzo
>>
>>test code at now:
>>Index: e_border.c
>>===================================================================
>>RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
>>retrieving revision 1.134
>>diff -u -r1.134 e_border.c
>>--- e_border.c 18 Apr 2005 08:39:05 -0000 1.134
>>+++ e_border.c 19 Apr 2005 12:17:47 -0000
>>@@ -57,6 +57,10 @@
>> static int _e_border_cb_mouse_wheel(void *data, int type, void *event);
>> static int _e_border_cb_grab_replay(void *data, int type, void *event);
>>
>>+/* godzzo evt test b */
>>+static int _e_border_cb_key_down (void *data, int type, void *event);
>>+/* godzzo evt test e */
>>+
>> static void _e_border_eval(E_Border *bd);
>> static void _e_border_resize_limit(E_Border *bd, int *w, int *h);
>> static void _e_border_moveinfo_gather(E_Border *bd, const char *source);
>>@@ -192,6 +196,104 @@
>> return 1;
>> }
>>
>>+/* godzzo evt test b */
>>+static int
>>+_e_border_cb_key_down(void *data, int type, void *event)
>>+{
>>+ Ecore_X_Event_Key_Down *ev;
>>+ E_Border *bd;
>>+ E_Desk *desk;
>>+ int intNewPos = 0;
>>+
>>+
>>+ ev = event;
>>+ bd = data;
>>+
>>+ if (ev->event_win != bd->win)
>>+ return 1;
>>+
>>+ if (!strcmp(ev->keyname, "F10") && ev->modifiers == 8)
>>+ {
>>+ if (bd->sticky) e_border_unstick(bd);
>>+ else e_border_stick(bd);
>>+ }
>>+ if (!strcmp(ev->keyname, "F9") && ev->modifiers == 8)
>>+ {
>>+ if (bd->shaded) e_border_unshade(bd, E_DIRECTION_UP);
>>+ else e_border_shade(bd, E_DIRECTION_UP);
>>+ }
>>+ if (!strcmp(ev->keyname, "F8") && ev->modifiers == 8)
>>+ {
>>+ if (bd->maximized) e_border_uniconify(bd);
>>+ else e_border_iconify(bd);
>>+ }
>>+ else if (!strcmp(ev->keyname, "F7") && ev->modifiers == 8)
>>+ {
>>+ _e_border_menu_show(bd, bd->x + 4, bd->y + 4);
>>+ }
>>+ else if (!strcmp(ev->keyname, "F6") && ev->modifiers == 8)
>>+ {
>>+ _e_border_menu_cb_icon_edit(bd, NULL, NULL);
>>+ }
>>+ else if (!strcmp(ev->keyname, "F5") && ev->modifiers == 8)
>>+ {
>>+ if (bd->maximized) e_border_unmaximize(bd);
>>+ else e_border_maximize(bd);
>>+ }
>>+ else if (!strcmp(ev->keyname, "F4") && ev->modifiers == 8)
>>+ {
>>+ _e_border_menu_cb_close(bd, NULL, NULL);
>>+ }
>>+ else if (!strcmp(ev->keyname, "Left") && ev->modifiers == 12)
>>+ {
>>+ intNewPos = bd->zone->desk_x_current - 1;
>>+
>>+ if (intNewPos < 0)
>>+ intNewPos = bd->zone->desk_x_count - 1;
>>+
>>+ desk = e_desk_at_xy_get(bd->zone, intNewPos,
>>bd->zone->desk_y_current);
>>+
>>+ e_desk_show(desk);
>>+ }
>>+ else if (!strcmp(ev->keyname, "Right") && ev->modifiers == 12)
>>+ {
>>+ intNewPos = bd->zone->desk_x_current + 1;
>>+
>>+ if (intNewPos > (bd->zone->desk_x_count - 1))
>>+ intNewPos = 0;
>>+
>>+ desk = e_desk_at_xy_get(bd->zone, intNewPos,
>>bd->zone->desk_y_current);
>>+
>>+ e_desk_show(desk);
>>+ }
>>+ else if (!strcmp(ev->keyname, "Up") && ev->modifiers == 12)
>>+ {
>>+ intNewPos = bd->zone->desk_y_current - 1;
>>+
>>+ if (intNewPos < 0)
>>+ intNewPos = bd->zone->desk_y_count - 1;
>>+
>>+ desk = e_desk_at_xy_get(bd->zone, bd->zone->desk_x_current,
>>intNewPos);
>>+
>>+ e_desk_show(desk);
>>+ }
>>+ else if (!strcmp(ev->keyname, "Down") && ev->modifiers == 12)
>>+ {
>>+ intNewPos = bd->zone->desk_y_current + 1;
>>+
>>+ if (intNewPos > (bd->zone->desk_y_count - 1))
>>+ intNewPos = 0;
>>+
>>+ desk = e_desk_at_xy_get(bd->zone, bd->zone->desk_x_current,
>>intNewPos);
>>+
>>+ e_desk_show(desk);
>>+ }
>>+
>>+
>>+ return 1;
>>+}
>>+/* godzzo evt test e */
>>+
>> E_Border *
>> e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
>> {
>>@@ -231,6 +333,31 @@
>> eb->modifiers,
>> 0);
>> }
>>+ /* godzzo evt test b */
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F10")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F9")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F8")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F7")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F6")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F5")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("F4")),
>>ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("Left")),
>>ECORE_X_MODIFIER_CTRL | ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(),
>>XStringToKeysym("Right")), ECORE_X_MODIFIER_CTRL | ECORE_X_MODIFIER_ALT,
>>bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("Up")),
>>ECORE_X_MODIFIER_CTRL | ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ XGrabKey (ecore_x_display_get(),
>>+ XKeysymToKeycode(ecore_x_display_get(), XStringToKeysym("Down")),
>>ECORE_X_MODIFIER_CTRL | ECORE_X_MODIFIER_ALT, bd->win, 0, 1, 1);
>>+ /* godzzo evt test e */
>>+
>> bd->bg_ecore_evas = ecore_evas_software_x11_new(NULL, bd->win, 0, 0,
>>bd->w, bd->h);
>> ecore_evas_software_x11_direct_resize_set(bd->bg_ecore_evas, 1);
>> e_canvas_add(bd->bg_ecore_evas);
>>@@ -263,6 +390,10 @@
>> bd->handlers = evas_list_append(bd->handlers,
>>ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE,
>>_e_border_cb_mouse_move, bd));
>> bd->handlers = evas_list_append(bd->handlers,
>>ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL,
>>_e_border_cb_mouse_wheel, bd));
>>
>>+/* godzzo evt test b */
>>+ bd->handlers = evas_list_append(bd->handlers,
>>ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, _e_border_cb_key_down,
>>bd));
>>+/* godzzo evt test e */
>>+
>> bd->client.win = win;
>>
>> bd->client.icccm.title = strdup("");
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by: New Crystal Reports XI.
>>Version 11 adds new functionality designed to reduce time involved in
>>creating, integrating, and deploying reporting solutions. Free runtime info,
>>new features, or free trial, at: http://www.businessobjects.com/devxi/728
>>_______________________________________________
>>enlightenment-devel mailing list
>>enlightenment-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>>
>>
>>
>
>
>
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel