Discard press event for ctrl+shift+release open_url mapping as it can causes issues when delivered to the terminal program

This commit is contained in:
Kovid Goyal 2021-06-07 17:00:09 +05:30
parent 11227b3ee1
commit 761062a6d7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 12 additions and 0 deletions

View File

@ -484,6 +484,13 @@ mma('Click the link under the mouse cursor',
' click based version has an unavoidable delay of :opt:`click_interval`, to disambiguate clicks from double clicks.'
)
mma('Click the link under the mouse cursor',
'click_url_discard ctrl+shift+left press grabbed mouse_discard_event',
long_text='Prevent this press event from being sent to the program that has'
' grabbed the mouse, as the corresponding release event is used to open a URL.'
)
mma('Paste from the primary selection',
'paste_selection middle release ungrabbed paste_selection',
)

View File

@ -859,6 +859,8 @@ defaults.mouse_map = [
MouseMapping(0, 5, -1, True, KeyAction('mouse_click_url')),
# click_url
MouseMapping(0, 5, -1, False, KeyAction('mouse_click_url')),
# click_url_discard
MouseMapping(0, 5, 1, True, KeyAction('mouse_discard_event')),
# paste_selection
MouseMapping(2, 0, -1, False, KeyAction('paste_selection')),
# start_simple_selection

View File

@ -829,6 +829,9 @@ class Window:
def mouse_click_url(self) -> None:
click_mouse_url(self.os_window_id, self.tab_id, self.id)
def mouse_discard_event(self) -> None:
pass
def mouse_click_url_or_select(self) -> None:
if not self.screen.has_selection():
self.mouse_click_url()