Print precommit string in callback
This commit is contained in:
parent
c6dc63cf82
commit
7817917cd1
1 changed files with 11 additions and 5 deletions
16
wayland.c
16
wayland.c
|
|
@ -105,12 +105,12 @@ void zwp_text_input_v3_leave_callback(void *data, struct zwp_text_input_v3 *text
|
||||||
|
|
||||||
void zwp_text_input_v3_preedit_string_callback(void *data, struct zwp_text_input_v3 *text_input, const char *text, int32_t cursor_begin, int32_t cursor_end)
|
void zwp_text_input_v3_preedit_string_callback(void *data, struct zwp_text_input_v3 *text_input, const char *text, int32_t cursor_begin, int32_t cursor_end)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "ZWP text input v3 preedit string callback\n");
|
fprintf(stdout, "ZWP text input v3 preedit string callback with text %s\n", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zwp_text_input_v3_commit_string_callback(void *data, struct zwp_text_input_v3 *text_input, const char *text)
|
void zwp_text_input_v3_commit_string_callback(void *data, struct zwp_text_input_v3 *text_input, const char *text)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "ZWP text input v3 commit string callback\n");
|
fprintf(stdout, "ZWP text input v3 commit string callback with text %s\n", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zwp_text_input_v3_delete_surrounding_text_callback(void *data, struct zwp_text_input_v3 *text_input, uint32_t before_length, uint32_t after_length)
|
void zwp_text_input_v3_delete_surrounding_text_callback(void *data, struct zwp_text_input_v3 *text_input, uint32_t before_length, uint32_t after_length)
|
||||||
|
|
@ -190,9 +190,15 @@ void leave_callback(void *data, struct wl_keyboard* kb, uint serial, struct wl_s
|
||||||
|
|
||||||
void key_callback(void *data, struct wl_keyboard *kb, uint serial, uint time, uint key, uint state)
|
void key_callback(void *data, struct wl_keyboard *kb, uint serial, uint time, uint key, uint state)
|
||||||
{
|
{
|
||||||
/* TODO: This does *not* respect the system's language defaults. At least not in KDE.
|
/* NOTE: libxkbcommon provides the correct glyphs if:
|
||||||
* Wayland's own (terrible) documentation does not go into detail about languages:
|
1. The user is using the system layout without an IME, or
|
||||||
* https://wayland-book.com/seat/xkb.html
|
2. The user is using an IME, but the current key is the same for both languages.
|
||||||
|
|
||||||
|
If none of them are true, wayback will either use text-input-v3's callbacks instead, or
|
||||||
|
call both functions.
|
||||||
|
|
||||||
|
For example, if the user is using spanish IME on US keymap and inputs the letter A, key_callback
|
||||||
|
will be called normally. However trying to write ñ or à won't call this function at all.
|
||||||
*/
|
*/
|
||||||
key += 8;
|
key += 8;
|
||||||
uint32_t layout = xkb_state_key_get_layout(xkb_state, key);
|
uint32_t layout = xkb_state_key_get_layout(xkb_state, key);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue