# HG changeset patch # User giacomo # Date 1179836649 25200 # Node ID 0cc6b35fbeb41c076cdc85355e7df5c84f718fa7 # Parent 2d6a00ed166fc7b5bf6f171276af86716ade5833 [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 diff -r 2d6a00ed166f -r 0cc6b35fbeb4 ChangeLog --- 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 + 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 revision [2272] - statusicon: strenghten checks before last strcmp in si_ui_statusicon_cb_hook_tchange diff -r 2d6a00ed166f -r 0cc6b35fbeb4 src/evdev-plug/ed_common.h --- 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" diff -r 2d6a00ed166f -r 0cc6b35fbeb4 src/evdev-plug/ed_ui.c --- 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; + } + } } } }