changeset 1055:0cc6b35fbeb4 trunk

[svn] - evdev-plug 0.2: do not intercept all event types, currently only pick types KEY and ABSOLUTE; there could be other event types that are worth intercepting, feedback needed about this
author giacomo
date Tue, 22 May 2007 05:24:09 -0700
parents 2d6a00ed166f
children 8e58b7dc2bd1
files ChangeLog src/evdev-plug/ed_common.h src/evdev-plug/ed_ui.c
diffstat 3 files changed, 26 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 22 02:28:58 2007 -0700
+++ b/ChangeLog	Tue May 22 05:24:09 2007 -0700
@@ -1,3 +1,10 @@
+2007-05-22 09:28:58 +0000  Giacomo Lozito <james@develia.org>
+  revision [2274]
+  - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
+  trunk/src/statusicon/si_ui.c |   25 ++++++++++---------------
+  1 file changed, 10 insertions(+), 15 deletions(-)
+
+
 2007-05-22 08:56:51 +0000  Giacomo Lozito <james@develia.org>
   revision [2272]
   - statusicon: strenghten checks before last strcmp in si_ui_statusicon_cb_hook_tchange
--- a/src/evdev-plug/ed_common.h	Tue May 22 02:28:58 2007 -0700
+++ b/src/evdev-plug/ed_common.h	Tue May 22 05:24:09 2007 -0700
@@ -30,7 +30,7 @@
 
 #include "../../config.h"
 
-#define ED_VERSION_PLUGIN "0.1"
+#define ED_VERSION_PLUGIN "0.2"
 #define ED_VERSION_CONFIG "0"
 
 #define PLAYER_LOCALRC_FILE "evdev-plug.conf"
--- a/src/evdev-plug/ed_ui.c	Tue May 22 02:28:58 2007 -0700
+++ b/src/evdev-plug/ed_ui.c	Tue May 22 05:24:09 2007 -0700
@@ -771,14 +771,24 @@
         }
         else
         {
-          /* the trigger-dialog window is open; record input and
-             store it in a container managed by the trigger-dialog itself */
-          ed_inputevent_t *dinputev = g_malloc(sizeof(ed_inputevent_t*));
-          dinputev->type = inputev.type;
-          dinputev->code = inputev.code;
-          dinputev->value = inputev.value;
-          g_object_set_data( G_OBJECT(trigger_dlg) , "trigger-data" , dinputev );
-          gtk_dialog_response( GTK_DIALOG(trigger_dlg) , GTK_RESPONSE_OK );
+          /* currently, only care about events of type 'key' and 'absolute'
+             TODO: should we handle some other event type as well? */
+          switch ( inputev.type )
+          {
+            case EV_KEY:
+            case EV_ABS:
+            {
+              /* the trigger-dialog window is open; record input and
+               store it in a container managed by the trigger-dialog itself */
+              ed_inputevent_t *dinputev = g_malloc(sizeof(ed_inputevent_t*));
+              dinputev->type = inputev.type;
+              dinputev->code = inputev.code;
+              dinputev->value = inputev.value;
+              g_object_set_data( G_OBJECT(trigger_dlg) , "trigger-data" , dinputev );
+              gtk_dialog_response( GTK_DIALOG(trigger_dlg) , GTK_RESPONSE_OK );
+              break;
+            }
+          }
         }
       }
     }