MCPcopy Create free account
hub / github.com/clementgallet/libTAS / XKeysymToKeycode

Function XKeysymToKeycode

src/library/inputs/xkeyboardlayout.cpp:175–192  ·  view source on GitHub ↗

Override */

Source from the content-addressed store, hash-verified

173}
174
175/* Override */ KeyCode XKeysymToKeycode( Display* display, KeySym keysym)
176{
177 LOG(LL_TRACE, LCF_KEYBOARD, "%s called with keysym %d", __func__, keysym);
178 KeyCode kc = 0;
179 for (int i=0; i<256; i++) {
180 if (Xlib_default_keymap[i] == keysym) {
181 kc = static_cast<KeyCode>(i);
182 break;
183 }
184 if (Xlib_default_keymap_shifted[i] == keysym) {
185 kc = static_cast<KeyCode>(i);
186 break;
187 }
188 }
189
190 LOG(LL_DEBUG, LCF_KEYBOARD, " returning %d", (int)kc);
191 return kc;
192}
193
194/* Override */ int XLookupString(XKeyEvent *event_struct, char *buffer_return, int bytes_buffer, KeySym *keysym_return, void *status_in_out)
195{

Callers 1

generateKeyEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected