back / forward key press events

This commit is contained in:
Artem Anufrij 2018-02-11 13:49:17 +01:00
parent bda5b56f34
commit b8f9cedbf4

View file

@ -146,6 +146,17 @@ namespace Webpin.Widgets {
} }
return base.button_press_event (event); return base.button_press_event (event);
}); });
web_view.key_press_event.connect ((event) => {
if (event.keyval == Gdk.Key.Back) {
web_view.go_back ();
return true;
} else if (event.keyval == Gdk.Key.Forward) {
web_view.go_forward ();
return true;
}
return base.key_press_event (event);
});
} }
} }
} }