MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / StringToSDLScancode

Function StringToSDLScancode

Source/UserInput/keyTranslator.cpp:764–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762}
763
764SDL_Scancode StringToSDLScancode(const std::string& s) {
765 std::map<std::string, SDL_Scancode>::const_iterator iter = str_to_key_map.find(UTF8ToLower(s));
766 if (iter != str_to_key_map.end()) {
767 return iter->second;
768 } else {
769 return (SDL_Scancode)SDL_SCANCODE_SYSREQ;
770 }
771}
772
773const char* SDLScancodeToString(SDL_Scancode key) {
774 std::map<SDL_Scancode, const char*>::const_iterator iter = key_to_str_map.find(key);

Callers 6

BindStringMethod · 0.85
HandleEventMethod · 0.85
IsKeyDownMethod · 0.85
AS_GetInputDownFilteredFunction · 0.85
AS_GetCodeForKeyFunction · 0.85

Calls 3

UTF8ToLowerFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected