diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 6c4341b54..6fd8238e9 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -284,7 +284,7 @@ class QuteBrowser(QApplication): # config self.config.style_changed.connect(style.invalidate_caches) for obj in [tabs, completion, self.mainwindow, config.cmd_history, - websettings, kp["normal"], modes.manager]: + websettings, kp["normal"]]: self.config.changed.connect(obj.on_config_changed) # statusbar diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index b795316bd..0216b4892 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -186,10 +186,6 @@ DATA = OrderedDict([ SettingValue(types.Bool(), "true"), "Whether to automatically enter insert mode if an editable element " "is focused after page load."), - - ('forward_unbound_keys', - SettingValue(types.Bool(), "false"), - "Whether to forward unbound keys to the website in normal mode."), )), ('tabbar', sect.KeyValue( diff --git a/qutebrowser/keyinput/modes.py b/qutebrowser/keyinput/modes.py index e5a075e6d..6c2f966ee 100644 --- a/qutebrowser/keyinput/modes.py +++ b/qutebrowser/keyinput/modes.py @@ -75,7 +75,6 @@ class ModeManager(QObject): _handlers: A dictionary of modes and their handlers. _mode_stack: A list of the modes we're currently in, with the active one on the right. - _forward_unbound_keys: If we should forward unbound keys. Signals: entered: Emitted when a mode is entered. @@ -94,8 +93,6 @@ class ModeManager(QObject): self._handlers = {} self.passthrough = [] self._mode_stack = [] - self._forward_unbound_keys = config.get('general', - 'forward_unbound_keys') @property def mode(self): @@ -160,13 +157,6 @@ class ModeManager(QObject): raise ValueError("Can't leave normal mode!") self.leave(self.mode) - @pyqtSlot(str, str) - def on_config_changed(self, section, option): - """Update local setting when config changed.""" - if (section, option) == ('general', 'forward_unbound_keys'): - self._forward_unbound_keys = config.get('general', - 'forward_unbound_keys') - def eventFilter(self, obj, evt): """Filter all events based on the currently set mode. @@ -213,17 +203,11 @@ class ModeManager(QObject): # KeyPress in a non-passthrough mode - call handler and filter # event from widgets (unless unhandled and configured to pass # unhandled events through) - logging.debug("KeyPress, calling handler {}".format(handler)) + logging.debug("KeyPress, calling handler {} and " + "filtering".format(handler)) self.key_pressed.emit(evt) handled = handler(evt) if handler is not None else False - logging.debug("handled: {}, forward_unbound_keys: {} -> " - "filtering: {}".format( - handled, self._forward_unbound_keys, - handled or not self._forward_unbound_keys)) - if handled or not self._forward_unbound_keys: - return True - else: - return False + return True else: # KeyRelease in a non-passthrough mode - filter event and # ignore it entirely.