Skip to content

Commit

Permalink
back / forward key press events
Browse files Browse the repository at this point in the history
  • Loading branch information
artemanufrij committed Feb 11, 2018
1 parent bda5b56 commit b8f9ced
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Widgets/Browser.vala
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ namespace Webpin.Widgets {
}
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);
});
}
}
}

0 comments on commit b8f9ced

Please sign in to comment.