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

Function xkeyboardToXMod

src/library/inputs/keyboard_helper.cpp:361–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}};
360
361unsigned int xkeyboardToXMod(const std::array<unsigned int,AllInputsFlat::MAXKEYS>& Xkeyboard) {
362 unsigned int mod = 0;
363 for (int i=0; i<AllInputsFlat::MAXKEYS; i++) {
364 if (Xkeyboard[i]) {
365 for (int j=0; j<10; j++) {
366 if (Xkeyboard[i] == mod_translate[j].keysym) {
367 mod |= mod_translate[j].xmod;
368 break;
369 }
370 }
371 }
372 }
373
374 return mod;
375}
376
377SDL_Keymod xkeyboardToSDLMod(const std::array<unsigned int,AllInputsFlat::MAXKEYS>& Xkeyboard) {
378 unsigned int mod = KMOD_NONE; // use int because "bitwise or" promotes to int

Callers 1

generateKeyEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected