MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / inputChar

Function inputChar

extern/glfw/src/wl_init.c:535–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533#endif
534
535static GLFWbool inputChar(_GLFWwindow* window, uint32_t key)
536{
537 uint32_t code, numSyms;
538 long cp;
539 const xkb_keysym_t *syms;
540 xkb_keysym_t sym;
541
542 code = key + 8;
543 numSyms = xkb_state_key_get_syms(_glfw.wl.xkb.state, code, &syms);
544
545 if (numSyms == 1)
546 {
547#ifdef HAVE_XKBCOMMON_COMPOSE_H
548 sym = composeSymbol(syms[0]);
549#else
550 sym = syms[0];
551#endif
552 cp = _glfwKeySym2Unicode(sym);
553 if (cp != -1)
554 {
555 const int mods = _glfw.wl.xkb.modifiers;
556 const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT));
557 _glfwInputChar(window, cp, mods, plain);
558 }
559 }
560
561 return xkb_keymap_key_repeats(_glfw.wl.xkb.keymap, syms[0]);
562}
563
564static void keyboardHandleKey(void* data,
565 struct wl_keyboard* keyboard,

Callers 1

keyboardHandleKeyFunction · 0.85

Calls 3

composeSymbolFunction · 0.85
_glfwKeySym2UnicodeFunction · 0.85
_glfwInputCharFunction · 0.85

Tested by

no test coverage detected