E-book viewer: Keyboard shortcuts for Back/Forward

Fixes #1186928 [Missing keyboard shortcut in the viewer](https://bugs.launchpad.net/calibre/+bug/1186928)
This commit is contained in:
Kovid Goyal 2013-06-03 15:22:20 +05:30
parent 230cbf46b0
commit 5c9dea7064
2 changed files with 12 additions and 0 deletions

View File

@ -1218,6 +1218,12 @@ class DocumentView(QWebView): # {{{
self.paged_col_scroll()
else:
self.scroll_by(x=15)
elif key == 'Back':
if self.manager is not None:
self.manager.back(None)
elif key == 'Forward':
if self.manager is not None:
self.manager.forward(None)
else:
handled = False
return handled

View File

@ -44,4 +44,10 @@ SHORTCUTS = {
'Right' : (['L', 'Right'],
_('Scroll right')),
'Back': (['Alt+Left'],
_('Back')),
'Forward': (['Alt+Right'],
_('Forward')),
}