Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        aclass.c 


Log Message:
Allow specifying any button (not just 1-5).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/aclass.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- aclass.c    18 Feb 2006 08:30:03 -0000      1.26
+++ aclass.c    11 Mar 2006 08:43:15 -0000      1.27
@@ -27,6 +27,7 @@
 #include "e16-ecore_list.h"
 #include "emodule.h"
 #include "ewins.h"
+#include <ctype.h>
 
 typedef struct _actiontype
 {
@@ -580,27 +581,12 @@
      case EVENT_DOUBLE_DOWN:
      case EVENT_MOUSE_ENTER:
      case EVENT_MOUSE_LEAVE:
-       switch (key[0])
-         {
-         case '*':
-            anybut = 1;
-            break;
-         case '1':
-            button = 1;
-            break;
-         case '2':
-            button = 2;
-            break;
-         case '3':
-            button = 3;
-            break;
-         case '4':
-            button = 4;
-            break;
-         case '5':
-            button = 5;
-            break;
-         }
+       if (key[0] == '*')
+          anybut = 1;
+       else if (isdigit(key[0]))
+          button = atoi(key);
+       if (!anybut && button == 0)
+          return NULL;         /* Invalid */
        key[0] = '\0';
        break;
      }




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to