From d1aac9e9e932668199c0835890ceb2c31bee038b Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 8 May 2017 23:43:21 -0700 Subject: [PATCH] Add docstrings to key_press methods --- qutebrowser/browser/webengine/webenginetab.py | 2 ++ qutebrowser/browser/webkit/webkittab.py | 1 + 2 files changed, 3 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index bb3f017ab..657b6e6da 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -312,6 +312,7 @@ class WebEngineScroller(browsertab.AbstractScroller): page.scrollPositionChanged.connect(self._update_pos) 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, 5000)): self._tab.key_press(key, modifier) @@ -652,6 +653,7 @@ class WebEngineTab(browsertab.AbstractTab): raise browsertab.UnsupportedOperationError def key_press(self, key, modifier=Qt.NoModifier): + """Send a fake key event to this WebKitTab.""" press_evt = QKeyEvent(QEvent.KeyPress, key, modifier, 0, 0, 0) release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier, 0, 0, 0) diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index f1f876a6e..44df236a2 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -699,6 +699,7 @@ class WebKitTab(browsertab.AbstractTab): self.networkaccessmanager().clear_all_ssl_errors() def key_press(self, key, modifier=Qt.NoModifier): + """Send a fake key event to this WebKitTab.""" press_evt = QKeyEvent(QEvent.KeyPress, key, modifier, 0, 0, 0) release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier, 0, 0, 0)