comparison src/evdev-plug/ed_ui.c @ 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 d124034ebea3
children 96cc46b1cf5e
comparison
equal deleted inserted replaced
1054:2d6a00ed166f 1055:0cc6b35fbeb4
769 /* the trigger-dialog window is not open; ignore input */ 769 /* the trigger-dialog window is not open; ignore input */
770 return TRUE; 770 return TRUE;
771 } 771 }
772 else 772 else
773 { 773 {
774 /* the trigger-dialog window is open; record input and 774 /* currently, only care about events of type 'key' and 'absolute'
775 store it in a container managed by the trigger-dialog itself */ 775 TODO: should we handle some other event type as well? */
776 ed_inputevent_t *dinputev = g_malloc(sizeof(ed_inputevent_t*)); 776 switch ( inputev.type )
777 dinputev->type = inputev.type; 777 {
778 dinputev->code = inputev.code; 778 case EV_KEY:
779 dinputev->value = inputev.value; 779 case EV_ABS:
780 g_object_set_data( G_OBJECT(trigger_dlg) , "trigger-data" , dinputev ); 780 {
781 gtk_dialog_response( GTK_DIALOG(trigger_dlg) , GTK_RESPONSE_OK ); 781 /* the trigger-dialog window is open; record input and
782 store it in a container managed by the trigger-dialog itself */
783 ed_inputevent_t *dinputev = g_malloc(sizeof(ed_inputevent_t*));
784 dinputev->type = inputev.type;
785 dinputev->code = inputev.code;
786 dinputev->value = inputev.value;
787 g_object_set_data( G_OBJECT(trigger_dlg) , "trigger-data" , dinputev );
788 gtk_dialog_response( GTK_DIALOG(trigger_dlg) , GTK_RESPONSE_OK );
789 break;
790 }
791 }
782 } 792 }
783 } 793 }
784 } 794 }
785 } 795 }
786 return TRUE; 796 return TRUE;