In kitty keyboard protocol, should associated text be repertod for non u
ending sequences
#8127
Replies: 3 comments 3 replies
-
On Mon, Dec 16, 2024 at 05:36:11PM -0800, Kirill Chibisov wrote:
On macOS function keys tend to carry some text, so pressing `F2` on macOS generates the `63237` (integer for char it generates, depends on how you obtain it), however the escape for `F2` is of a form `CSI 1 Q`, which is not `u` ending one.
What keyboard encoding on macOS produces text from function keys?
Pressing F1 inside textEdit doesnt for me on US and US International at
least.
Should it be reported as `CSI 1 ; 63237 Q` (only associated text enabled) or should terminal discard the associated text entirely. If so clarification could be needed to tell that associated text can not be present for keys that are not `CSI u`.
The trailer only affects the value of the *number* field (the first
number of the escape code that encodes the key identity. For non-u
trailers the number is always 1. The rest of the escape code is
identical in form to the one with u trailer. The only reason for the
alternate trailers is for legacy compatibility so that the form of the
encoding matches that in the legacy protocol then there are no
modifiers, or only the legacy supported modifiers. and no
shifted/alternate keys/text.
|
Beta Was this translation helpful? Give feedback.
-
IIRC I know that this is more of a true for F21-F24, since they're encoded inside the |
Beta Was this translation helpful? Give feedback.
-
You should not be using NSEvent directly to handle key events in Cocoa,
if you do that your keyboard handling will not match platform native
applications. IIRC you need to call some combination of UCKeyTranslate
and interpretKeyEvents and then reverse engineer what cocoa would do
with the key. Yes, Apple's keyboard API's suck.
Pressing no function key F1-F12 produces text in any cocoa native
application as far as I know in US layout.
But anyway, as far as your question about the protocol itself is
concerned, there is no restriction on non-u forms of the escape code,
other than the one I already mentioned about the first number field
being 1.
|
Beta Was this translation helpful? Give feedback.
-
On macOS function keys tend to carry some text, so pressing
F2
on macOS generates the63237
(integer for char it generates, depends on how you obtain it), however the escape forF2
is of a formCSI 1 Q
, which is notu
ending one.Should it be reported as
CSI 1 ; 63237 Q
(only associated text enabled) or should terminal discard the associated text entirely. If so clarification could be needed to tell that associated text can not be present for keys that are notCSI u
.Beta Was this translation helpful? Give feedback.
All reactions