mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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.
This commit is contained in:

committed by
Simon Tatham

parent
ef5c017a5f
commit
d0500732f7
6
gtk.c
6
gtk.c
@ -1205,10 +1205,14 @@ static gint button_event(GtkWidget *widget, GdkEventButton *event,
|
|||||||
button = RIGHT_BUTTON;
|
button = RIGHT_BUTTON;
|
||||||
else if (event->button == 1)
|
else if (event->button == 1)
|
||||||
button = LEFT_BUTTON;
|
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
|
else
|
||||||
return FALSE; /* don't even know what button! */
|
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;
|
button += LEFT_RELEASE - LEFT_BUTTON;
|
||||||
|
|
||||||
if (!midend_process_key(fe->me, event->x - fe->ox,
|
if (!midend_process_key(fe->me, event->x - fe->ox,
|
||||||
|
Reference in New Issue
Block a user