From 2cd2c60a8b02a0fb2093003bfea14e1771f28112 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 29 Nov 2018 19:30:28 +0100 Subject: [PATCH] Rename key_press to fake_key_press --- qutebrowser/browser/browsertab.py | 10 +++++----- qutebrowser/browser/webengine/webenginetab.py | 6 +++--- qutebrowser/browser/webkit/webkittab.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index ad5f42ab2..3b39e52d1 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -512,9 +512,9 @@ class AbstractCaret(QObject): def _follow_enter(self, tab: bool) -> None: """Follow a link by faking an enter press.""" if tab: - self._tab.key_press(Qt.Key_Enter, modifier=Qt.ControlModifier) + self._tab.fake_key_press(Qt.Key_Enter, modifier=Qt.ControlModifier) else: - self._tab.key_press(Qt.Key_Enter) + self._tab.fake_key_press(Qt.Key_Enter) def follow_selected(self, *, tab: bool = False) -> None: raise NotImplementedError @@ -1045,9 +1045,9 @@ class AbstractTab(QWidget): def stop(self) -> None: raise NotImplementedError - def key_press(self, - key: Qt.Key, - modifier: Qt.KeyboardModifier = Qt.NoModifier) -> None: + def fake_key_press(self, + key: Qt.Key, + modifier: Qt.KeyboardModifier = Qt.NoModifier) -> None: """Send a fake key event to this tab.""" press_evt = QKeyEvent(QEvent.KeyPress, key, modifier, 0, 0, 0) release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier, diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index ecbbd0ab0..453b36974 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -423,7 +423,7 @@ class WebEngineScroller(browsertab.AbstractScroller): def _repeated_key_press(self, key, count=1, modifier=Qt.NoModifier): """Send count fake key presses to this scroller's WebEngineTab.""" for _ in range(min(count, 1000)): - self._tab.key_press(key, modifier) + self._tab.fake_key_press(key, modifier) @pyqtSlot(QPointF) def _update_pos(self, pos): @@ -500,10 +500,10 @@ class WebEngineScroller(browsertab.AbstractScroller): self._repeated_key_press(Qt.Key_Right, count) def top(self): - self._tab.key_press(Qt.Key_Home) + self._tab.fake_key_press(Qt.Key_Home) def bottom(self): - self._tab.key_press(Qt.Key_End) + self._tab.fake_key_press(Qt.Key_End) def page_up(self, count=1): self._repeated_key_press(Qt.Key_PageUp, count) diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 7f1b8783a..2c7083c25 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -474,7 +474,7 @@ class WebKitScroller(browsertab.AbstractScroller): if (getter is not None and frame.scrollBarValue(direction) == getter(direction)): return - self._tab.key_press(key) + self._tab.fake_key_press(key) def up(self, count=1): self._key_press(Qt.Key_Up, count, 'scrollBarMinimum', Qt.Vertical)