macos: handle preedit in AppKit, enables Korean input

This commit is contained in:
Mitchell Hashimoto
2023-11-10 09:51:22 -08:00
parent 9be9f11586
commit dd1faf5e50
3 changed files with 137 additions and 29 deletions

View File

@@ -292,6 +292,14 @@ typedef enum {
GHOSTTY_KEY_RIGHT_SUPER,
} ghostty_input_key_e;
typedef struct {
ghostty_input_action_e action;
ghostty_input_mods_e mods;
uint32_t keycode;
const char *text;
bool composing;
} ghostty_input_key_s;
typedef struct {
ghostty_input_key_e key;
ghostty_input_mods_e mods;
@@ -414,7 +422,7 @@ void ghostty_surface_refresh(ghostty_surface_t);
void ghostty_surface_set_content_scale(ghostty_surface_t, double, double);
void ghostty_surface_set_focus(ghostty_surface_t, bool);
void ghostty_surface_set_size(ghostty_surface_t, uint32_t, uint32_t);
void ghostty_surface_key(ghostty_surface_t, ghostty_input_action_e, uint32_t, ghostty_input_mods_e);
void ghostty_surface_key(ghostty_surface_t, ghostty_input_key_s);
void ghostty_surface_text(ghostty_surface_t, const char *, uintptr_t);
void ghostty_surface_mouse_button(ghostty_surface_t, ghostty_input_mouse_state_e, ghostty_input_mouse_button_e, ghostty_input_mods_e);
void ghostty_surface_mouse_pos(ghostty_surface_t, double, double);