Add some colors to keyboad debug output
This commit is contained in:
parent
572466eed1
commit
cdcf8ed3bd
2
glfw/xkb_glfw.c
vendored
2
glfw/xkb_glfw.c
vendored
@ -711,7 +711,7 @@ glfw_xkb_handle_key_event(_GLFWwindow *window, _GLFWXKBData *xkb, xkb_keycode_t
|
|||||||
#else
|
#else
|
||||||
ibus_keycode -= 8;
|
ibus_keycode -= 8;
|
||||||
#endif
|
#endif
|
||||||
debug("%s xkb_keycode: 0x%x ", action == GLFW_RELEASE ? "Release" : "Press", xkb_keycode);
|
debug("%s xkb_keycode: 0x%x ", action == GLFW_RELEASE ? "\x1b[32mRelease\x1b[m" : "\x1b[31mPress\x1b[m", xkb_keycode);
|
||||||
XKBStateGroup *sg = &xkb->states;
|
XKBStateGroup *sg = &xkb->states;
|
||||||
int num_syms = xkb_state_key_get_syms(sg->state, code_for_sym, &syms);
|
int num_syms = xkb_state_key_get_syms(sg->state, code_for_sym, &syms);
|
||||||
int num_clean_syms = xkb_state_key_get_syms(sg->clean_state, code_for_sym, &clean_syms);
|
int num_clean_syms = xkb_state_key_get_syms(sg->clean_state, code_for_sym, &clean_syms);
|
||||||
|
|||||||
@ -97,7 +97,7 @@ on_key_input(GLFWkeyevent *ev) {
|
|||||||
const uint32_t key = ev->key, native_key = ev->native_key;
|
const uint32_t key = ev->key, native_key = ev->native_key;
|
||||||
const char *text = ev->text ? ev->text : "";
|
const char *text = ev->text ? ev->text : "";
|
||||||
|
|
||||||
debug("on_key_input: glfw key: %d native_code: 0x%x action: %s mods: 0x%x text: '%s' state: %d ",
|
debug("\x1b[33mon_key_input\x1b[m: glfw key: %d native_code: 0x%x action: %s mods: 0x%x text: '%s' state: %d ",
|
||||||
key, native_key,
|
key, native_key,
|
||||||
(action == GLFW_RELEASE ? "RELEASE" : (action == GLFW_PRESS ? "PRESS" : "REPEAT")),
|
(action == GLFW_RELEASE ? "RELEASE" : (action == GLFW_PRESS ? "PRESS" : "REPEAT")),
|
||||||
mods, text, ev->ime_state);
|
mods, text, ev->ime_state);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user