diff options
| author | Jonas Kölker <jonaskoelker@yahoo.com> | 2015-10-02 18:17:15 +0200 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-10-14 21:22:44 +0100 |
| commit | d0500732f7bdab97ecaece2c5c74dd18f8122ea4 (patch) | |
| tree | 742f41e7ae4627c7e0d69c15e5140f52f3457870 | |
| parent | ef5c017a5f6863b5f8f2085b0c26106765d73ffb (diff) | |
| download | puzzles-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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, |