Extend the SGR Pixel mouse reporting protocol to also report when the mouse leaves the window

This commit is contained in:
Kovid Goyal
2025-07-12 11:59:23 +05:30
parent c3360cd76e
commit 4d3bbd82e0
8 changed files with 87 additions and 24 deletions

View File

@@ -109,6 +109,8 @@ Detailed list of changes
0.42.2 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- A new :ref:`protocol extension <mouse_leave_window>` to notify terminal programs that have turned on SGR Pixel mouse reporting when the mouse leaves the window (:disc:`8808`)
- Fix :opt:`remember_window_position` not working because of a stupid typo (:iss:`8646`)
- A new :option:`kitty --grab-keyboard` that can be used to grab the keyboard so that global shortcuts are sent to kitty instead

View File

@@ -29,6 +29,19 @@ there is only one number to reset these attributes, SGR 22, which resets both.
There is no way to reset one and not the other. kitty uses 221 and 222 to reset
bold and faint independently.
.. _mouse_leave_window:
Reporting when the mouse leaves the window
----------------------------------------------
kitty extends the SGR Pixel mouse reporting protocol created by xterm to
also report when the mouse leaves the window. This is event is delivered
encoded as a normal SGR pixel event except that the eight bit is set on the
first number. bits 1-7 are used to encode button and modifier information.
When bit 8 is set it means the event is a mouse has left the window event,
and all other bits should be ignored. The pixel position values must also
be ignored as they may not be accurate.
kitty specific private escape codes
---------------------------------------