aboutsummaryrefslogtreecommitdiff
path: root/src/narrative_window.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-08-20 10:10:35 +0200
committerThomas White <taw@bitwiz.org.uk>2015-08-20 10:10:35 +0200
commitdca7e738e22dca153d9ff9a5fb7f1f83e3967dd7 (patch)
tree9e3e9c4577eef0ddd786195d0ce1f713d727dbd3 /src/narrative_window.c
parentc3eb827e44633ae7633f519cd803cb79e71f2aee (diff)
Make PgUp/PgDn work for slide show in narrative window
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r--src/narrative_window.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 3cfbb1b..0210eeb 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -326,6 +326,31 @@ static gboolean button_press_sig(GtkWidget *da, GdkEventButton *event,
}
+static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event,
+ NarrativeWindow *nw)
+{
+ switch ( event->keyval ) {
+
+ case GDK_KEY_Page_Up :
+ if ( nw->show != NULL) {
+ ss_prev_slide(nw->show, nw);
+ return TRUE;
+ }
+ break;
+
+ case GDK_KEY_Page_Down :
+ if ( nw->show != NULL) {
+ ss_next_slide(nw->show, nw);
+ return TRUE;
+ }
+ break;
+
+ }
+
+ return FALSE;
+}
+
+
static void nw_update_titlebar(NarrativeWindow *nw)
{
get_titlebar_string(nw->p);
@@ -507,6 +532,8 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app)
g_signal_connect(G_OBJECT(nw->sceditor), "button-press-event",
G_CALLBACK(button_press_sig), nw);
+ g_signal_connect(G_OBJECT(nw->sceditor), "key-press-event",
+ G_CALLBACK(key_press_sig), nw);
g_signal_connect(G_OBJECT(nw->sceditor), "configure-event",
G_CALLBACK(resize_sig), nw);