summaryrefslogtreecommitdiff
path: root/src/input/KeyEncoder.zig
AgeCommit message (Collapse)Author
2023-09-29input: don't ESC prefix non-ascii charactersTim Culverhouse
User input withe Alt modifier is typically ESC prefixed. Escape prefixing a non-ascii character can cause bugs in some applications. For example in bash, emitting an Alt+ф allows the user to backspace one character into the prompt. This can be repeated multiple times. When a character is outside the ASCII range (exclusive of 0x7F, this is handled as a control sequence), print the character as is, with no prefix.
2023-09-29input(kitty): fix reporting of alternate keysTim Culverhouse
Fix reporting of alternate keys when using the kitty protocol. Alternate keyboard layouts were failing to report the "base layout" key. This implementation now matches kitty's output 1:1, and has some added unit tests for cyrillic characters. This also fixes a bug where a caps_lock modified key would report the shifted key as well. The protocol explicitly requires that shifted keys are only reported if the shift modifier is true.
2023-09-27input: 0x7F is a control character, use helperMitchell Hashimoto
Fixes #556 One check for control chars was missing 0x7F. Since we do this three times, extract it to a helper and call that.
2023-09-20input: correct xterm encoding for modified F1-F4Mitchell Hashimoto
Fixes #499
2023-09-19input: kitty alternates and text should not include control charactersMitchell Hashimoto
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-24input: kitty should not encode modifier-only key unless "report all"Mitchell Hashimoto
2023-08-24apprt/embedded: do not translate control charactersMitchell Hashimoto
macOS translates inputs such as shift+tab into the control character tab (ascii 0x09). Linux/GTK does not translate character inputs except to printable characters. We don't want control character translations because these are all handled manually by our key encoder (i.e. translating ctrl+c to 0x03).
2023-08-22input: kitty encoding should only output unmodified utf8 if printableMitchell Hashimoto
2023-08-21input: pc style function keys should use all mods, not effectiveMitchell Hashimoto
2023-08-17input: remove old TODO. This is handled now in the app runtimesMitchell Hashimoto
2023-08-17input: repeat events need to be handled for Kitty w/o report eventsMitchell Hashimoto
2023-08-17input: proper optional entry handlingMitchell Hashimoto
2023-08-17input: Kitty encodes alternate keysMitchell Hashimoto
2023-08-17core: use Kitty encoding if enabledMitchell Hashimoto
2023-08-17input: lot more Kitty encoding logicMitchell Hashimoto
2023-08-17input: KittySequence for encoding sequencesMitchell Hashimoto
2023-08-16input: begin kitty key encoding logic (not working yet)Mitchell Hashimoto
2023-08-16input: do not send ctrl-sequences for ctrl-i,m,[Mitchell Hashimoto
2023-08-16input: clarify why we use all mods for unicode CSI uMitchell Hashimoto
2023-08-16input: CSI u encoding for modified unicode charsMitchell Hashimoto
2023-08-16input: encoding should always write to the bufMitchell Hashimoto
2023-08-16input: legacy encoding never emits sequence during dead key stateMitchell Hashimoto
2023-08-16core: start on key2Callback for the new callback that uses KeyEncoderMitchell Hashimoto
2023-08-16input: legacy key encoding handles alt-as-esc for general utf8Mitchell Hashimoto
2023-08-16input: KeyEncoder handles the charCallback stuff now tooMitchell Hashimoto
2023-08-16input: KeyEncoder legacy encoding handles old keyCallback logicMitchell Hashimoto
2023-08-16input: starting to work on KeyEncoder, got ctrl sequencesMitchell Hashimoto