diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 54cc054b2e..0acf2daccd 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -438,7 +438,7 @@ public: ie.DeviceKind = InputDeviceKind::mouse; ie.Modifiers = SDL_GetModState(); ie.Button = e.button.button; - ie.State = InputEventState::Down; + ie.State = InputEventState::down; _inputManager.QueueInputEvent(std::move(ie)); } break; @@ -474,7 +474,7 @@ public: ie.DeviceKind = InputDeviceKind::mouse; ie.Modifiers = SDL_GetModState(); ie.Button = e.button.button; - ie.State = InputEventState::Release; + ie.State = InputEventState::release; _inputManager.QueueInputEvent(std::move(ie)); } break; @@ -544,14 +544,14 @@ public: #endif _textComposition.HandleMessage(&e); auto ie = GetInputEventFromSDLEvent(e); - ie.State = InputEventState::Down; + ie.State = InputEventState::down; _inputManager.QueueInputEvent(std::move(ie)); break; } case SDL_KEYUP: { auto ie = GetInputEventFromSDLEvent(e); - ie.State = InputEventState::Release; + ie.State = InputEventState::release; _inputManager.QueueInputEvent(std::move(ie)); break; } diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 080f289a6c..42ab5a8adb 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -51,7 +51,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e) ie.DeviceKind = InputDeviceKind::joyAxis; ie.Modifiers = SDL_GetModState(); ie.Button = e.caxis.axis; - ie.State = InputEventState::Down; + ie.State = InputEventState::down; ie.AxisValue = e.caxis.value; QueueInputEvent(std::move(ie)); } @@ -65,7 +65,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e) ie.DeviceKind = InputDeviceKind::joyHat; ie.Modifiers = SDL_GetModState(); ie.Button = e.jhat.value; - ie.State = InputEventState::Down; + ie.State = InputEventState::down; ie.AxisValue = 0; QueueInputEvent(std::move(ie)); } @@ -78,7 +78,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e) ie.DeviceKind = InputDeviceKind::joyButton; ie.Modifiers = SDL_GetModState(); ie.Button = e.cbutton.button; - ie.State = InputEventState::Down; + ie.State = InputEventState::down; ie.AxisValue = 0; QueueInputEvent(std::move(ie)); break; @@ -90,7 +90,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e) ie.DeviceKind = InputDeviceKind::joyButton; ie.Modifiers = SDL_GetModState(); ie.Button = e.cbutton.button; - ie.State = InputEventState::Release; + ie.State = InputEventState::release; ie.AxisValue = 0; QueueInputEvent(std::move(ie)); break; @@ -352,7 +352,7 @@ void InputManager::Process(const InputEvent& e) auto w = windowMgr->FindByClass(WindowClass::textinput); if (w != nullptr) { - if (e.State == InputEventState::Release) + if (e.State == InputEventState::release) { OpenRCT2::Ui::Windows::WindowTextInputKey(w, e.Button); } @@ -363,7 +363,7 @@ void InputManager::Process(const InputEvent& e) w = windowMgr->FindByClass(WindowClass::loadsaveOverwritePrompt); if (w != nullptr) { - if (e.State == InputEventState::Release) + if (e.State == InputEventState::release) { OpenRCT2::Ui::Windows::WindowLoadSaveOverwritePromptInputKey(w, e.Button); } @@ -374,7 +374,7 @@ void InputManager::Process(const InputEvent& e) w = windowMgr->FindByClass(WindowClass::loadsave); if (w != nullptr) { - if (e.State == InputEventState::Release) + if (e.State == InputEventState::release) { OpenRCT2::Ui::Windows::WindowLoadSaveInputKey(w, e.Button); } @@ -392,7 +392,7 @@ void InputManager::Process(const InputEvent& e) void InputManager::ProcessInGameConsole(const InputEvent& e) { - if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::Release) + if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::release) { auto input = ConsoleInput::None; switch (e.Button) @@ -427,7 +427,7 @@ void InputManager::ProcessInGameConsole(const InputEvent& e) void InputManager::ProcessChat(const InputEvent& e) { - if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::Down) + if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::down) { auto input = ChatInput::None; switch (e.Button) diff --git a/src/openrct2-ui/input/InputManager.h b/src/openrct2-ui/input/InputManager.h index 3399ee8dc2..48e28ee20b 100644 --- a/src/openrct2-ui/input/InputManager.h +++ b/src/openrct2-ui/input/InputManager.h @@ -32,8 +32,8 @@ namespace OpenRCT2::Ui enum class InputEventState { - Down, - Release, + down, + release, }; struct InputEvent diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index f3ddf66423..8767dc5abb 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -59,7 +59,7 @@ bool RegisteredShortcut::Matches(const InputEvent& e) const bool RegisteredShortcut::IsSuitableInputEvent(const InputEvent& e) const { // Do not intercept button releases - if (e.State == InputEventState::Release) + if (e.State == InputEventState::release) { return false; }