summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-06-04 23:38:46 +0200
committerThomas White <taw@physics.org>2019-06-04 23:38:46 +0200
commitc7603ca74b3d85731c2482713e6bd0f2856ab4f3 (patch)
tree471f124ac65f4998686e96e06e7039a283d40c0c
parentb485f458fcc428b1440c1fcd01be30fea30a1684 (diff)
Playback control hooks
-rw-r--r--src/nanolight.c20
1 files 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;