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

Function XQueryKeymap

src/library/inputs/xkeyboard.cpp:33–54  ·  view source on GitHub ↗

Override */

Source from the content-addressed store, hash-verified

31namespace libtas {
32
33/* Override */ int XQueryKeymap( Display* display, char keymap[32])
34{
35 LOGTRACE(LCF_KEYBOARD);
36
37 memset(keymap, 0, 32);
38 GlobalNoLog gnl; // Avoid logging on XkbKeycodeToKeysym
39 for (int i=0; i<AllInputsFlat::MAXKEYS; i++) {
40 if (Inputs::game_ai.keyboard[i] == 0) {
41 break;
42 }
43 for (int kc=0; kc<256; kc++) {
44 KeySym ks = XkbKeycodeToKeysym(display, (KeyCode)kc, 0, 0);
45 if (ks == Inputs::game_ai.keyboard[i]) {
46 keymap[kc>>3] |= (1 << (kc&0x7));
47 break;
48 }
49 }
50 }
51
52 /* I don't know what it should return */
53 return 0;
54}
55
56/* Override */ int XGrabKey(Display*, int, unsigned int, Window, Bool, int, int)
57{

Callers

nothing calls this directly

Calls 1

XkbKeycodeToKeysymFunction · 0.85

Tested by

no test coverage detected