Use ctrl-enter in all cases

This commit is contained in:
Jay Kamat 2018-06-10 16:27:56 -07:00
parent de127497a2
commit 315ed519ee
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 10 additions and 4 deletions

View File

@ -337,8 +337,10 @@ class WebEngineCaret(browsertab.AbstractCaret):
return
if js_elem == "focused":
# we had a focused element, not a selected one. Just send <enter>
self._tab.key_press(Qt.Key_Enter)
return
if tab:
self._tab.key_press(Qt.Key_Enter, modifier=Qt.ControlModifier)
else:
self._tab.key_press(Qt.Key_Enter)
assert isinstance(js_elem, dict), js_elem
elem = webengineelem.WebEngineElement(js_elem, tab=self._tab)

View File

@ -389,10 +389,14 @@ class WebKitCaret(browsertab.AbstractCaret):
selection = self._widget.selectedHtml()
if not selection:
# Getting here may mean we crashed, but we can't do anything
# about that:
# about that until this commit is released:
# https://github.com/annulen/webkit/commit/0e75f3272d149bc64899c161f150eb341a2417af
# TODO find a way to check if something is focused
self._tab.key_press(Qt.Key_Enter)
if tab:
self._tab.key_press(Qt.Key_Enter,
modifier=Qt.ControlModifier)
else:
self._tab.key_press(Qt.Key_Enter)
return
try:
selected_element = xml.etree.ElementTree.fromstring(