Pass the event time in key events

This commit is contained in:
Tomeu Vizoso 2009-07-12 14:11:41 +02:00
parent d22e690822
commit 8d21a6d884
2 changed files with 9 additions and 7 deletions

View File

@ -83,8 +83,9 @@ sugar_key_grabber_class_init(SugarKeyGrabberClass *grabber_class)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (SugarKeyGrabberClass, key_pressed), G_STRUCT_OFFSET (SugarKeyGrabberClass, key_pressed),
NULL, NULL, NULL, NULL,
sugar_marshal_BOOLEAN__UINT_UINT, sugar_marshal_BOOLEAN__UINT_UINT_UINT,
G_TYPE_BOOLEAN, 2, G_TYPE_BOOLEAN, 3,
G_TYPE_UINT,
G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_UINT); G_TYPE_UINT);
signals[KEY_RELEASED] = g_signal_new ("key-released", signals[KEY_RELEASED] = g_signal_new ("key-released",
@ -92,8 +93,9 @@ sugar_key_grabber_class_init(SugarKeyGrabberClass *grabber_class)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (SugarKeyGrabberClass, key_released), G_STRUCT_OFFSET (SugarKeyGrabberClass, key_released),
NULL, NULL, NULL, NULL,
sugar_marshal_BOOLEAN__UINT_UINT, sugar_marshal_BOOLEAN__UINT_UINT_UINT,
G_TYPE_BOOLEAN, 2, G_TYPE_BOOLEAN, 3,
G_TYPE_UINT,
G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_UINT); G_TYPE_UINT);
} }
@ -123,7 +125,7 @@ filter_events(GdkXEvent *xevent, GdkEvent *event, gpointer data)
if (xev->type == KeyRelease) { if (xev->type == KeyRelease) {
int return_value; int return_value;
g_signal_emit (grabber, signals[KEY_RELEASED], 0, xev->xkey.keycode, g_signal_emit (grabber, signals[KEY_RELEASED], 0, xev->xkey.keycode,
xev->xkey.state, &return_value); xev->xkey.state, xev->xkey.time, &return_value);
if(return_value) if(return_value)
return GDK_FILTER_REMOVE; return GDK_FILTER_REMOVE;
} }
@ -131,7 +133,7 @@ filter_events(GdkXEvent *xevent, GdkEvent *event, gpointer data)
if (xev->type == KeyPress) { if (xev->type == KeyPress) {
int return_value; int return_value;
g_signal_emit (grabber, signals[KEY_PRESSED], 0, xev->xkey.keycode, g_signal_emit (grabber, signals[KEY_PRESSED], 0, xev->xkey.keycode,
xev->xkey.state, &return_value); xev->xkey.state, xev->xkey.time, &return_value);
if(return_value) if(return_value)
return GDK_FILTER_REMOVE; return GDK_FILTER_REMOVE;
} }

View File

@ -1 +1 @@
BOOLEAN:UINT,UINT BOOLEAN:UINT,UINT,UINT