* Alan Schmitt ([EMAIL PROTECTED]) wrote:
> 
> Now that 16.7.1 is out, is there a chance that this patch gets 
> integrated ?

Sorry to answer my own message, but I realized it would make Kwo's life 
easier if I provided a new patch against the current (anonymous) cvs.  
Here it is attached.

Alan Schmitt

-- 
The hacker: someone who figured things out and made something cool happen.
.O.
..O
OOO
Index: E.h
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.323
diff -u -p -r1.323 E.h
--- E.h 20 Aug 2004 21:13:55 -0000      1.323
+++ E.h 25 Aug 2004 14:45:14 -0000
@@ -1104,6 +1104,10 @@ typedef struct
    } hints;
    struct
    {
+      KeySym              left, right, up, down, escape, ret;
+   } menukeys;
+   struct
+   {
       char                enable;
       char                zoom;
       char                title;
Index: conf.h
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/conf.h,v
retrieving revision 1.34
diff -u -p -r1.34 conf.h
--- conf.h      3 Jul 2004 00:58:19 -0000       1.34
+++ conf.h      25 Aug 2004 14:45:14 -0000
@@ -155,6 +155,8 @@
 #define CONTROL_ST_PAGER 1383
 #define CONTROL_ST_WARPLIST 1384
 
+#define CONTROL_MENU_NAVIGATION_KEYS 1390
+
 #define ICLASS_NAME 350
 #define ICLASS_NORMAL 351
 #define ICLASS_CLICKED 352
Index: config.c
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.113
diff -u -p -r1.113 config.c
--- config.c    3 Aug 2004 02:43:50 -0000       1.113
+++ config.c    25 Aug 2004 14:45:14 -0000
@@ -648,6 +648,7 @@ Config_Control(FILE * ConfigFile)
     */
 
    char                s[FILEPATH_LEN_MAX];
+   char                s2[FILEPATH_LEN_MAX];
    int                 i1, i2, i3, fields;
    float               f1;
 
@@ -984,6 +985,30 @@ Config_Control(FILE * ConfigFile)
          case CONTROL_DOCKAPP_SUPPORT:
             Conf.dockapp_support = i2;
             break;
+          case CONTROL_MENU_NAVIGATION_KEYS:
+             sscanf(s, "%*i %*i %s", s2);
+             switch(i2)
+               {
+               case 0:
+                 Conf.menukeys.left = XStringToKeysym(s2);
+                 break;
+               case 1:
+                 Conf.menukeys.right = XStringToKeysym(s2);
+                 break;
+               case 2:
+                 Conf.menukeys.up = XStringToKeysym(s2);
+                 break;
+               case 3:
+                 Conf.menukeys.down = XStringToKeysym(s2);
+                 break;
+               case 4:
+                 Conf.menukeys.escape = XStringToKeysym(s2);
+                 break;
+               case 5:
+                 Conf.menukeys.ret = XStringToKeysym(s2);
+                 break;
+               }
+             break;
          default:
             RecoverUserConfig();
             Alert(_("Warning: unable to determine what to do with\n"
@@ -3918,6 +3943,12 @@ SaveUserControlConfig(FILE * autosavefil
        fprintf(autosavefile, "1383 %i\n", (int)Conf.st_trans.pager);
        fprintf(autosavefile, "1384 %i\n", (int)Conf.st_trans.warplist);
 #endif
+        fprintf(autosavefile, "1390 0 %s\n", XKeysymToString(Conf.menukeys.left));
+        fprintf(autosavefile, "1390 1 %s\n", XKeysymToString(Conf.menukeys.right));
+        fprintf(autosavefile, "1390 2 %s\n", XKeysymToString(Conf.menukeys.up));
+        fprintf(autosavefile, "1390 3 %s\n", XKeysymToString(Conf.menukeys.down));
+        fprintf(autosavefile, "1390 4 %s\n", XKeysymToString(Conf.menukeys.escape));
+        fprintf(autosavefile, "1390 5 %s\n", XKeysymToString(Conf.menukeys.ret));
 #ifdef  HAS_XINERAMA
        fprintf(autosavefile, "2013 %i\n", (int)Conf.extra_head);
 #endif
Index: menus.c
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.152
diff -u -p -r1.152 menus.c
--- menus.c     13 Aug 2004 20:41:25 -0000      1.152
+++ menus.c     25 Aug 2004 14:45:14 -0000
@@ -2196,6 +2196,28 @@ MenuFindContextEwin(Menu * m)
    return FindEwinSpawningMenu(m);
 }
 
+KeySym
+MenuKeyPressConversion(KeySym key)
+{
+  if (key == Conf.menukeys.left)
+    return XK_Left;
+  if (key == Conf.menukeys.right)
+    return XK_Right;
+  if (key == Conf.menukeys.up)
+    return XK_Up;
+  if (key == Conf.menukeys.down)
+    return XK_Down;
+  if (key == Conf.menukeys.escape)
+    return XK_Escape;
+  if (key == Conf.menukeys.ret)
+    return XK_Return;
+
+  /* The key does not correspond to any set, use the default behavior 
+   * associated to the key */
+  return key;
+}
+  
+
 int
 MenusEventKeyPress(XEvent * ev)
 {
@@ -2219,7 +2241,7 @@ MenusEventKeyPress(XEvent * ev)
    /* NB! m != NULL */
 
    key = XLookupKeysym(&ev->xkey, 0);
-   switch (key)
+   switch (MenuKeyPressConversion(key))
      {
      case XK_Escape:
        MenusHide();
Index: setup.c
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v
retrieving revision 1.139
diff -u -p -r1.139 setup.c
--- setup.c     25 Jul 2004 09:34:43 -0000      1.139
+++ setup.c     25 Aug 2004 14:45:14 -0000
@@ -456,6 +456,13 @@ SetupX(void)
    Conf.st_trans.warplist = ICLASS_ATTR_BG;
 #endif
 
+   Conf.menukeys.left = XK_Left;
+   Conf.menukeys.right = XK_Right;
+   Conf.menukeys.up = XK_Up;
+   Conf.menukeys.down = XK_Down;
+   Conf.menukeys.escape = XK_Escape;
+   Conf.menukeys.ret = XK_Return;
+
    ScreenInit();
 
    MenusInit();

Attachment: pgpF6OjhUrMQu.pgp
Description: PGP signature

Reply via email to