From d0500732f7bdab97ecaece2c5c74dd18f8122ea4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20K=C3=B6lker?= Date: Fri, 2 Oct 2015 18:17:15 +0200 Subject: [PATCH] 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. --- gtk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, -- 2.30.2