From c7603ca74b3d85731c2482713e6bd0f2856ab4f3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 4 Jun 2019 23:38:46 +0200 Subject: Playback control hooks --- src/nanolight.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nanolight.c b/src/nanolight.c index 2ed51ce..adebcc4 100644 --- a/src/nanolight.c +++ b/src/nanolight.c @@ -238,10 +238,6 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, struct nanoligh gboolean r; int claim = 0; - /* Throw the event to the IM context and let it sort things out */ - r = gtk_im_context_filter_keypress(GTK_IM_CONTEXT(nl->im_context), event); - if ( r ) return FALSE; /* IM ate it */ - switch ( event->keyval ) { case GDK_KEY_Left : @@ -270,6 +266,22 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, struct nanoligh redraw(nl); break; + case GDK_KEY_KP_Enter : + printf("Go!\n"); + claim = 1; + break; + + case GDK_KEY_KP_Add : + printf("Stop/back!\n"); + claim = 1; + break; + + } + + if ( !claim ) { + /* Throw the event to the IM context and let it sort things out */ + r = gtk_im_context_filter_keypress(GTK_IM_CONTEXT(nl->im_context), event); + if ( r ) claim = 1; } if ( claim ) return TRUE; -- cgit v1.2.3