summaryrefslogtreecommitdiff
path: root/src/input/function_keys.zig
AgeCommit message (Collapse)Author
2025-10-04input: use std.Io.Writer for key encoder, new API, expose via libghosttyMitchell Hashimoto
This modernizes `KeyEncoder` to a new `std.Io.Writer`-based API. Additionally, instead of a single struct, it is now an `encode` function that takes a series of more focused options. This is more idiomatic Zig while also making it easier to expose via libghostty-vt. libghostty-vt also gains access to key encoding APIs.
2025-10-03Zig 0.15: zig build test Mitchell Hashimoto
2025-05-09input: remove translatedMitchell Hashimoto
2025-03-12Lots of 0.14 changesMitchell Hashimoto
2024-12-20Change to F3 legacy encoding with modifiers (#3019)Mitchell Hashimoto
The [fixterms](http://www.leonerd.org.uk/hacks/fixterms/) "Really Special Keypresses" section suggests using CSI 1 ; Ps R for F3, but this is also a valid cursor position report. The intention was to make back-compatible changes, so this is fairly considered a specification bug. This changes F3 in legacy mode to send CSI 13 ; Ps ~ instead, this is a variant listed in fixterms, is what kitty protocol uses, and lacks the problematic overlap with cursor positions. The KeyEncoder.zig unit test has been changed accordingly, and all tests pass on my machine.
2024-12-19Change to F3 legacy encoding with modifiersSam Atman
The [fixterms](http://www.leonerd.org.uk/hacks/fixterms/) "Really Special Keypresses" section suggests using CSI 1 ; Ps R for F3, but this is also a valid cursor position report. The intention was to make back- compatible changes, so this is fairly considered a specification bug. This changes F3 in legacy mode to send CSI 13 ; Ps ~ instead, this is a variant listed in fixterms, is what kitty protocol uses, and lacks the problematic overlap with cursor positions. The KeyEncoder.zig unit test has been changed accordingly, and all tests pass on my machine.
2024-12-19Docfix: correct comment for modifyOtherKeys sequenceSam Atman
The comment in `function_keys.zig` was missing the `>` character for the sequence. I've confirmed that this was just the comment, Ghostty treats the original as an SGR sequence, which it is. Conversely, it does treat `\x1b[>4:2m` as activating modifyOtherKeys.
2024-08-05chore: clean up typosƁukasz Niemier
2024-01-09input: missing kp_begin encoding entryMitchell Hashimoto
2023-12-27input: only send keypad events for keypad application modeMitchell Hashimoto
Fixes #1099
2023-12-13key: add additional keypad keysTim Culverhouse
Add additional keypad keys to the encoding scheme. This allows Ghostty to report KP_HOME and it's relatives. We also always check for a keyval first, so we can report KP_7, etc as opposed to ASCII '7'.
2023-09-20input: correct xterm encoding for modified F1-F4Mitchell Hashimoto
Fixes #499
2023-08-26input: keypad enter should act as normal "\r" if no other seq matchesMitchell Hashimoto
This matches Kitty behavior on both macOS and Linux. In certain keyboard modes and Kitty keyboard modes, the behavior changes but those already matched (tested).
2023-08-13input: various more helpersMitchell Hashimoto
2023-08-13core: match and emit function keysMitchell Hashimoto
2023-08-13input: add all the mappings for pc style function keysMitchell Hashimoto
Not hooked up yet.