diff options
author | Matt Singleton <matt@xcolour.net> | 2022-01-16 12:02:38 -0600 |
---|---|---|
committer | Matt Singleton <matt@xcolour.net> | 2022-01-16 13:04:41 -0600 |
commit | b7b84113cc21f444b6ffdd86cf39008bc15e8f83 (patch) | |
tree | 68d7d99ff2e718f4eaa2560657dd2cf5166204f2 | |
parent | fdf5165ebb37cf7cf7c02bec0f7c35f800ade755 (diff) |
basic keybindings
-rw-r--r-- | TODO.md | 15 | ||||
-rwxr-xr-x | browser.py | 11 |
2 files changed, 19 insertions, 7 deletions
@@ -1,13 +1,14 @@ - [x] open non-gemini links externally and display differently - [ ] keyboard navigation - - vim-style - - scroll - - highlight and follow links - - forward and back - - url bar - - [ ] search in page - - [ ] work with search pages + - [x] scroll + - [ ] highlight and follow links + - [x] forward and back + - [ ] url bar + - [ ] search in page - [x] stdlib url parsing in gemini module - [x] nice typography - [x] html templates - [ ] deal with non utf8 charsets + - [ ] handle all response codes + - [ ] errors (4x, 5x) + - [ ] search @@ -87,6 +87,17 @@ class GBrowser(QtWidgets.QMainWindow): self.setWindowTitle('Gemini Browser') self.show() + # Shortcuts + down_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_J), self) + down_event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Down, QtCore.Qt.NoModifier) + down_shortcut.activated.connect(lambda: QtWidgets.QApplication.sendEvent(self._browser.focusProxy(), down_event)) + up_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_K), self) + up_event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Up, QtCore.Qt.NoModifier) + up_shortcut.activated.connect(lambda: QtWidgets.QApplication.sendEvent(self._browser.focusProxy(), up_event)) + back_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_H), self, self._browser.back) + forward_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_L), self, self._browser.forward) + reload_shortcut = QtGui.QShortcut(QtGui.QKeySequence("Shift+R"), self, self._browser.reload) + def set_status_url(self, url): if url: self.statusBar().showMessage(url) |