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