diff --git a/kitty/options/definition.py b/kitty/options/definition.py index d456e3f2c..772665e6a 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -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', ) diff --git a/kitty/options/types.py b/kitty/options/types.py index 2259e347f..99dfc6d8c 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -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 diff --git a/kitty/window.py b/kitty/window.py index d7889e504..42030f7c1 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -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()