libghostty
Loading...
Searching...
No Matches
key/encoder.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_KEY_ENCODER_H
8#define GHOSTTY_VT_KEY_ENCODER_H
9
10#include <stddef.h>
11#include <stdint.h>
12#include <ghostty/vt/types.h>
14#include <ghostty/vt/terminal.h>
16
26
36typedef uint8_t GhosttyKittyKeyFlags;
37
39#define GHOSTTY_KITTY_KEY_DISABLED 0
40
42#define GHOSTTY_KITTY_KEY_DISAMBIGUATE (1 << 0)
43
45#define GHOSTTY_KITTY_KEY_REPORT_EVENTS (1 << 1)
46
48#define GHOSTTY_KITTY_KEY_REPORT_ALTERNATES (1 << 2)
49
51#define GHOSTTY_KITTY_KEY_REPORT_ALL (1 << 3)
52
54#define GHOSTTY_KITTY_KEY_REPORT_ASSOCIATED (1 << 4)
55
57#define GHOSTTY_KITTY_KEY_ALL (GHOSTTY_KITTY_KEY_DISAMBIGUATE | GHOSTTY_KITTY_KEY_REPORT_EVENTS | GHOSTTY_KITTY_KEY_REPORT_ALTERNATES | GHOSTTY_KITTY_KEY_REPORT_ALL | GHOSTTY_KITTY_KEY_REPORT_ASSOCIATED)
58
67typedef enum {
77
86typedef enum {
89
92
95
98
101
104
108
123
135
158
177
243GhosttyResult ghostty_key_encoder_encode(GhosttyKeyEncoder encoder, GhosttyKeyEvent event, char *out_buf, size_t out_buf_size, size_t *out_len);
244
245#endif /* GHOSTTY_VT_KEY_ENCODER_H */
uint8_t GhosttyKittyKeyFlags
Definition key/encoder.h:36
struct GhosttyKeyEncoder * GhosttyKeyEncoder
Definition key/encoder.h:25
GhosttyResult ghostty_key_encoder_new(const GhosttyAllocator *allocator, GhosttyKeyEncoder *encoder)
GhosttyKeyEncoderOption
Definition key/encoder.h:86
GhosttyOptionAsAlt
Definition key/encoder.h:67
void ghostty_key_encoder_setopt(GhosttyKeyEncoder encoder, GhosttyKeyEncoderOption option, const void *value)
struct GhosttyKeyEvent * GhosttyKeyEvent
Definition key/event.h:24
GhosttyResult ghostty_key_encoder_encode(GhosttyKeyEncoder encoder, GhosttyKeyEvent event, char *out_buf, size_t out_buf_size, size_t *out_len)
void ghostty_key_encoder_free(GhosttyKeyEncoder encoder)
void ghostty_key_encoder_setopt_from_terminal(GhosttyKeyEncoder encoder, GhosttyTerminal terminal)
@ GHOSTTY_KEY_ENCODER_OPT_IGNORE_KEYPAD_WITH_NUMLOCK
Definition key/encoder.h:94
@ GHOSTTY_KEY_ENCODER_OPT_KITTY_FLAGS
@ GHOSTTY_KEY_ENCODER_OPT_CURSOR_KEY_APPLICATION
Definition key/encoder.h:88
@ GHOSTTY_KEY_ENCODER_OPT_ALT_ESC_PREFIX
Definition key/encoder.h:97
@ GHOSTTY_KEY_ENCODER_OPT_KEYPAD_KEY_APPLICATION
Definition key/encoder.h:91
@ GHOSTTY_KEY_ENCODER_OPT_MODIFY_OTHER_KEYS_STATE_2
@ GHOSTTY_KEY_ENCODER_OPT_MACOS_OPTION_AS_ALT
@ GHOSTTY_OPTION_AS_ALT_FALSE
Definition key/encoder.h:69
@ GHOSTTY_OPTION_AS_ALT_TRUE
Definition key/encoder.h:71
@ GHOSTTY_OPTION_AS_ALT_LEFT
Definition key/encoder.h:73
@ GHOSTTY_OPTION_AS_ALT_RIGHT
Definition key/encoder.h:75
struct GhosttyTerminal * GhosttyTerminal
Definition terminal.h:43
GhosttyResult
Definition types.h:13