MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetCheatKeyName

Function GetCheatKeyName

engine/Poseidon/Input/KeyboardState.cpp:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace
32{
33RString GetCheatKeyName(int dikCode)
34{
35 if (dikCode >= SDL_SCANCODE_A && dikCode <= SDL_SCANCODE_Z)
36 {
37 char text[2] = {static_cast<char>('A' + (dikCode - SDL_SCANCODE_A)), '\0'};
38 return RString(text);
39 }
40 if (dikCode >= SDL_SCANCODE_1 && dikCode <= SDL_SCANCODE_9)
41 {
42 char text[2] = {static_cast<char>('1' + (dikCode - SDL_SCANCODE_1)), '\0'};
43 return RString(text);
44 }
45 if (dikCode == SDL_SCANCODE_0)
46 return RString("0");
47 return GetKeyName(dikCode);
48}
49} // namespace
50
51void KeyboardState::BufferKeyEvent(int scancode, bool down, DWORD timestamp)

Callers 1

ProcessKeyPressedMethod · 0.85

Calls 2

GetKeyNameFunction · 0.85
RStringClass · 0.50

Tested by

no test coverage detected