Add docstrings to key_press methods
This commit is contained in:
parent
5bdd291d28
commit
d1aac9e9e9
@ -312,6 +312,7 @@ class WebEngineScroller(browsertab.AbstractScroller):
|
|||||||
page.scrollPositionChanged.connect(self._update_pos)
|
page.scrollPositionChanged.connect(self._update_pos)
|
||||||
|
|
||||||
def _repeated_key_press(self, key, count=1, modifier=Qt.NoModifier):
|
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)):
|
for _ in range(min(count, 5000)):
|
||||||
self._tab.key_press(key, modifier)
|
self._tab.key_press(key, modifier)
|
||||||
|
|
||||||
@ -652,6 +653,7 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
raise browsertab.UnsupportedOperationError
|
raise browsertab.UnsupportedOperationError
|
||||||
|
|
||||||
def key_press(self, key, modifier=Qt.NoModifier):
|
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)
|
press_evt = QKeyEvent(QEvent.KeyPress, key, modifier, 0, 0, 0)
|
||||||
release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier,
|
release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier,
|
||||||
0, 0, 0)
|
0, 0, 0)
|
||||||
|
@ -699,6 +699,7 @@ class WebKitTab(browsertab.AbstractTab):
|
|||||||
self.networkaccessmanager().clear_all_ssl_errors()
|
self.networkaccessmanager().clear_all_ssl_errors()
|
||||||
|
|
||||||
def key_press(self, key, modifier=Qt.NoModifier):
|
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)
|
press_evt = QKeyEvent(QEvent.KeyPress, key, modifier, 0, 0, 0)
|
||||||
release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier,
|
release_evt = QKeyEvent(QEvent.KeyRelease, key, modifier,
|
||||||
0, 0, 0)
|
0, 0, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user