diff --git a/qutebrowser/keyinput/modeparsers.py b/qutebrowser/keyinput/modeparsers.py index 257937852..db540b58e 100644 --- a/qutebrowser/keyinput/modeparsers.py +++ b/qutebrowser/keyinput/modeparsers.py @@ -294,12 +294,12 @@ class RegisterKeyParser(keyparser.CommandKeyParser): if super().handle(e): return True - if utils.keyevent_to_string(e) is None: - # this is a modifier key, let it pass and keep going - return False - key = e.text() + if key == '' or utils.keyevent_to_string(e) is None: + # this is not a proper register key, let it pass and keep going + return False + tabbed_browser = objreg.get('tabbed-browser', scope='window', window=self._win_id) macro_recorder = objreg.get('macro-recorder') diff --git a/tests/end2end/features/keyinput.feature b/tests/end2end/features/keyinput.feature index 3b4248e83..6777056e8 100644 --- a/tests/end2end/features/keyinput.feature +++ b/tests/end2end/features/keyinput.feature @@ -260,3 +260,19 @@ Feature: Keyboard input When I run :record-macro And I press the key "" Then "Leaving mode KeyMode.record_macro (reason: leave current)" should be logged + + Scenario: Ignoring non-register keys + Given I open data/scroll/simple.html + And I run :tab-only + When I run :scroll down with count 2 + And I wait until the scroll position changed + And I run :record-macro + And I press the key "" + And I press the key "c" + And I run :scroll up + And I wait until the scroll position changed + And I run :record-macro + And I run :run-macro + And I press the key "c" + And I wait until the scroll position changed to 0/0 + Then the page should not be scrolled