MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetInputEventFromSDLEvent

Function GetInputEventFromSDLEvent

src/openrct2-ui/UiContext.cpp:1045–1069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1043 }
1044
1045 InputEvent GetInputEventFromSDLEvent(const SDL_Event& e)
1046 {
1047 InputEvent ie;
1048 ie.deviceKind = InputDeviceKind::keyboard;
1049 ie.modifiers = e.key.keysym.mod;
1050 ie.button = e.key.keysym.sym;
1051
1052 // Handle dead keys
1053 if (ie.button == (SDLK_SCANCODE_MASK | 0))
1054 {
1055 switch (e.key.keysym.scancode)
1056 {
1057 case SDL_SCANCODE_APOSTROPHE:
1058 ie.button = '\'';
1059 break;
1060 case SDL_SCANCODE_GRAVE:
1061 ie.button = '`';
1062 break;
1063 default:
1064 break;
1065 }
1066 }
1067
1068 return ie;
1069 }
1070
1071 void SetAudioVolume(float value)
1072 {

Callers 1

ProcessMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected