Send key events to ibus
This commit is contained in:
parent
8675659fcb
commit
9c48e4965c
3
glfw/ibus_glfw.c
vendored
3
glfw/ibus_glfw.c
vendored
@ -325,11 +325,12 @@ key_event_processed(DBusMessage *msg, const char* errmsg, void *data) {
|
|||||||
uint32_t handled;
|
uint32_t handled;
|
||||||
if (!glfw_dbus_get_args(msg, "Failed to get IBUS handled key from reply", DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) return;
|
if (!glfw_dbus_get_args(msg, "Failed to get IBUS handled key from reply", DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) return;
|
||||||
KeyEvent *ev = (KeyEvent*)data;
|
KeyEvent *ev = (KeyEvent*)data;
|
||||||
|
debug("IBUS processed scancode: 0x%x release: %d handled: %u\n", ev->keycode, ev->action == GLFW_RELEASE, handled);
|
||||||
free(ev);
|
free(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWbool
|
GLFWbool
|
||||||
process_key(const KeyEvent *ev_) {
|
ibus_process_key(const KeyEvent *ev_) {
|
||||||
if (!check_connection(ev_->ibus)) return GLFW_FALSE;
|
if (!check_connection(ev_->ibus)) return GLFW_FALSE;
|
||||||
KeyEvent *ev = malloc(sizeof(KeyEvent));
|
KeyEvent *ev = malloc(sizeof(KeyEvent));
|
||||||
if (!ev) return GLFW_FALSE;
|
if (!ev) return GLFW_FALSE;
|
||||||
|
|||||||
2
glfw/ibus_glfw.h
vendored
2
glfw/ibus_glfw.h
vendored
@ -49,4 +49,4 @@ void glfw_connect_to_ibus(_GLFWIBUSData *ibus);
|
|||||||
void glfw_ibus_terminate(_GLFWIBUSData *ibus);
|
void glfw_ibus_terminate(_GLFWIBUSData *ibus);
|
||||||
void glfw_ibus_set_focused(_GLFWIBUSData *ibus, GLFWbool focused);
|
void glfw_ibus_set_focused(_GLFWIBUSData *ibus, GLFWbool focused);
|
||||||
void glfw_ibus_dispatch(_GLFWIBUSData *ibus);
|
void glfw_ibus_dispatch(_GLFWIBUSData *ibus);
|
||||||
GLFWbool process_key(const KeyEvent *ev_);
|
GLFWbool ibus_process_key(const KeyEvent *ev_);
|
||||||
|
|||||||
5
glfw/xkb_glfw.c
vendored
5
glfw/xkb_glfw.c
vendored
@ -428,7 +428,10 @@ glfw_xkb_handle_key_event(_GLFWwindow *window, _GLFWXKBData *xkb, xkb_keycode_t
|
|||||||
debug("clean_sym: %s ", glfw_xkb_keysym_name(clean_syms[0]));
|
debug("clean_sym: %s ", glfw_xkb_keysym_name(clean_syms[0]));
|
||||||
ev.action = action; ev.glfw_modifiers = xkb->modifiers; ev.keycode = scancode; ev.keysym = glfw_sym;
|
ev.action = action; ev.glfw_modifiers = xkb->modifiers; ev.keycode = scancode; ev.keysym = glfw_sym;
|
||||||
ev.ibus = &xkb->ibus;
|
ev.ibus = &xkb->ibus;
|
||||||
process_key(&ev);
|
if (ibus_process_key(&ev)) {
|
||||||
|
debug(" queued in IBUS\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
|
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
|
||||||
const char *text_type = "composed_text";
|
const char *text_type = "composed_text";
|
||||||
glfw_sym = compose_symbol(xkb, syms[0]);
|
glfw_sym = compose_symbol(xkb, syms[0]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user