Mitchell Hashimoto
1ff81682f7
input: add format support for tuple args
2023-11-06 09:19:59 -08:00
Gregory Anders
0a2d435481
core: add resize_split binding with default keys
...
On macOS, use Cmd+Ctrl+Arrow keys as default bindings for resizing by 10
points in the given direction.
2023-11-05 20:20:39 -06:00
Gregory Anders
e7745dc820
core: add support for bindings with multiple parameters
...
This commit adds support for bindings with multiple parameters. For
example, a "resize_split" binding will have two parameters: the resize
direction and the resize amount. Multiple parameters are supported by
using a tuple as the enum value and are written in string form by
separating each argument with a comma. Example: "resize_split:up,10".
2023-11-05 20:20:39 -06:00
Mitchell Hashimoto
debeba99db
input: Binding.Trigger format
2023-11-03 17:48:19 -07:00
Mitchell Hashimoto
cb4bb8aaf6
input: add Binding.Action.format to convert action to string
2023-11-03 15:57:14 -07:00
Leo Razoumov
dc527bd2cb
feat: keybind escape sequence action "esc:text" similar to "csi:text"
2023-11-02 17:50:17 -04:00
Mitchell Hashimoto
29bbcbbf92
core: add input binding to control terminal inspector
2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
d50ff6ece7
macos: complete cimgui events
2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
879bdf27a9
core: scroll viewport back to bottom on any key input that isn't a mod
...
Fixes #619
This changes the behavior from requiring printable text to any input
that isn't a modifier and also generates some data we send to the pty.
If there is printable text, we also clear the selection.
2023-10-15 08:53:38 -07:00
Mitchell Hashimoto
d97e5b9dab
input: legacy encoding pc style keys should ignore directional modifiers
2023-10-12 12:28:26 -07:00
Mitchell Hashimoto
47ee1e7355
input: Binding string can be unconsumed with "unconsumed:" prefix
2023-09-29 21:34:23 -07:00
Mitchell Hashimoto
9d0e7ab138
input: binding set can track unconsumed triggers
2023-09-29 20:18:41 -07:00
Mitchell Hashimoto
ecb1d19890
input: fix regression with ascii mapping to a keypad key
2023-09-29 20:00:50 -07:00
Mitchell Hashimoto
7bbe669641
Merge pull request #578 from rockorager/dev
...
Kitty keyboard improvements
2023-09-29 11:56:34 -07:00
Mitchell Hashimoto
a2e2889f2b
input: make Key ascii functions comptime-generated
2023-09-29 11:54:05 -07:00
Tim Culverhouse
11cb6824cd
input: don't ESC prefix non-ascii characters
...
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-29 08:35:21 -07:00
Tim Culverhouse
fb649e689d
input(kitty): fix reporting of alternate keys
...
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-29 06:37:08 -05:00
Mitchell Hashimoto
35a4427f54
input: 0x7F is a control character, use helper
...
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-27 07:57:21 -07:00
Mitchell Hashimoto
510f0fe8f2
apprt/embedded: if a physical key input is a keypad key, keep it
2023-09-22 11:44:18 -07:00
Mitchell Hashimoto
9ad27924a6
input: correct xterm encoding for modified F1-F4
...
Fixes #499
2023-09-20 14:33:55 -07:00
Mitchell Hashimoto
ff74f27b99
macos: send caps lock state to UCKeyTranslate
2023-09-19 15:42:36 -07:00
Mitchell Hashimoto
62a35417ab
input: kitty alternates and text should not include control characters
2023-09-19 15:18:00 -07:00
Mitchell Hashimoto
58a43f1980
config: store some basic errors on parse
2023-09-11 09:10:26 -07:00
Mitchell Hashimoto
4570356e57
turn zoom into a toggle rather than an explicit zoom/unzoom
2023-09-02 16:03:51 -07:00
Mitchell Hashimoto
519a97b782
core: add unzoom_split binding
2023-09-02 15:15:12 -07:00
Mitchell Hashimoto
50a1a52ae3
core: add zoom keybinding for splits
2023-09-02 14:52:43 -07:00
Mitchell Hashimoto
67bc9f59ed
input: kitty keymap was missing page up/down
2023-08-31 14:32:42 -07:00
Mitchell Hashimoto
369ffebb72
input: when overwriting a binding, we must update the reverse map
2023-08-31 13:08:33 -07:00
Mitchell Hashimoto
fe5da86bb0
input: maintain a reverse mapping to quickly look up trigger by action
2023-08-31 12:45:43 -07:00
Mitchell Hashimoto
ba883ce39a
add ghostty_config_trigger C API to find a trigger for an action
2023-08-30 22:14:44 -07:00
Mitchell Hashimoto
17e46bf0f4
input: move action parsing to dedicating Action.parse
2023-08-30 21:39:25 -07:00
Mitchell Hashimoto
39c2332d35
input: keypad enter should act as normal "\r" if no other seq matches
...
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-26 07:43:22 -07:00
Mitchell Hashimoto
e7c11f7d13
input: kitty should not encode modifier-only key unless "report all"
2023-08-24 21:24:41 -07:00
Mitchell Hashimoto
3a93aaf9cf
apprt/embedded: do not translate control characters
...
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-24 15:01:57 -07:00
Mitchell Hashimoto
5e45dc3386
input: kitty encoding should only output unmodified utf8 if printable
2023-08-22 15:00:53 -07:00
Mitchell Hashimoto
99abff85dd
input: pc style function keys should use all mods, not effective
2023-08-21 08:10:27 -07:00
Mitchell Hashimoto
7ccf86b175
remove imgui and devmode
...
imgui has been a source of compilation challenges (our fault not theirs)
and devmode hasn't worked in awhile, so drop it.
2023-08-20 08:50:24 -07:00
Thorsten Ball
2e9b787668
macOS: new window can inherit font size
...
This is the second part of #281 and adds the same mechanism that was
added for tabs in #296 for windows.
It works exactly the same way.
2023-08-19 09:29:56 +02:00
Mitchell Hashimoto
4f5460475c
Merge pull request #296 from mitchellh/mrn/macos-inherit-font-size
...
macOS: inherit font size when creating new tab
2023-08-18 09:22:06 -07:00
Mitchell Hashimoto
b7e1122224
input: remove old TODO. This is handled now in the app runtimes
2023-08-17 12:59:22 -07:00
Thorsten Ball
d2dae7a696
macOS: inherit font size when creating new tab
...
This is one part of #281 .
2023-08-17 20:56:56 +02:00
Mitchell Hashimoto
91456fe420
input: repeat events need to be handled for Kitty w/o report events
2023-08-17 11:23:13 -07:00
Mitchell Hashimoto
78080f0cd6
input: proper optional entry handling
2023-08-17 09:52:44 -07:00
Mitchell Hashimoto
6493da0dd3
input: Kitty encodes alternate keys
2023-08-17 09:51:16 -07:00
Mitchell Hashimoto
fe0e1f5ee8
input: key must provide unshifted codepoint
2023-08-17 09:40:32 -07:00
Mitchell Hashimoto
37daf02804
core: use Kitty encoding if enabled
2023-08-17 09:02:43 -07:00
Mitchell Hashimoto
fb9dc74b29
input: lot more Kitty encoding logic
2023-08-17 08:55:37 -07:00
Mitchell Hashimoto
91ba53b081
input: KittySequence for encoding sequences
2023-08-17 08:43:40 -07:00
Mitchell Hashimoto
c5177f6609
input: begin kitty key encoding logic (not working yet)
2023-08-16 22:08:16 -07:00
Mitchell Hashimoto
b42178bf34
input: add kitty keymap data
2023-08-16 22:08:05 -07:00