aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Kölker <jonaskoelker@yahoo.com>2015-10-02 18:17:15 +0200
committerSimon Tatham <anakin@pobox.com>2015-10-14 21:22:44 +0100
commitd0500732f7bdab97ecaece2c5c74dd18f8122ea4 (patch)
tree742f41e7ae4627c7e0d69c15e5140f52f3457870
parentef5c017a5f6863b5f8f2085b0c26106765d73ffb (diff)
downloadpuzzles-d0500732f7bdab97ecaece2c5c74dd18f8122ea4.zip
puzzles-d0500732f7bdab97ecaece2c5c74dd18f8122ea4.tar.gz
puzzles-d0500732f7bdab97ecaece2c5c74dd18f8122ea4.tar.bz2
puzzles-d0500732f7bdab97ecaece2c5c74dd18f8122ea4.tar.xz
In GTK frontend, bind mouse8/mouse9 to undo/redo.
These button codes are generated by the back/forward button pair on the sides of some mice, and web browsers treat these as the back and forward actions in the page history.
-rw-r--r--gtk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk.c b/gtk.c
index 0333e54..94a0722 100644
--- a/gtk.c
+++ b/gtk.c
@@ -1205,10 +1205,14 @@ static gint button_event(GtkWidget *widget, GdkEventButton *event,
button = RIGHT_BUTTON;
else if (event->button == 1)
button = LEFT_BUTTON;
+ else if (event->button == 8 && event->type == GDK_BUTTON_PRESS)
+ button = 'u';
+ else if (event->button == 9 && event->type == GDK_BUTTON_PRESS)
+ button = 'r';
else
return FALSE; /* don't even know what button! */
- if (event->type == GDK_BUTTON_RELEASE)
+ if (event->type == GDK_BUTTON_RELEASE && button >= LEFT_BUTTON)
button += LEFT_RELEASE - LEFT_BUTTON;
if (!midend_process_key(fe->me, event->x - fe->ox,