From 26c513b91b830a05acd50e6b158b4210f99b484c Mon Sep 17 00:00:00 2001 From: lightmanLP <50497969+lightmanLP@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:54:24 +0000 Subject: [PATCH] mUseKeydownEventToCreateNewMapping -> mUseInputToCreateNewMapping --- .../controldevice/controller/ControllerButton.cpp | 10 +++++----- .../controldevice/controller/ControllerButton.h | 2 +- .../controldevice/controller/ControllerStick.cpp | 10 +++++----- .../controldevice/controller/ControllerStick.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/controller/controldevice/controller/ControllerButton.cpp b/src/controller/controldevice/controller/ControllerButton.cpp index 44a915f84..fc81dc193 100644 --- a/src/controller/controldevice/controller/ControllerButton.cpp +++ b/src/controller/controldevice/controller/ControllerButton.cpp @@ -14,7 +14,7 @@ namespace Ship { ControllerButton::ControllerButton(uint8_t portIndex, CONTROLLERBUTTONS_T bitmask) - : mPortIndex(portIndex), mBitmask(bitmask), mUseKeydownEventToCreateNewMapping(false), + : mPortIndex(portIndex), mBitmask(bitmask), mUseInputToCreateNewMapping(false), mKeyboardScancodeForNewMapping(LUS_KB_UNKNOWN), mMouseButtonForNewMapping(LUS_MOUSE_BTN_UNKNOWN) { } @@ -178,7 +178,7 @@ bool ControllerButton::HasMappingsForShipDeviceIndex(ShipDeviceIndex lusIndex) { bool ControllerButton::AddOrEditButtonMappingFromRawPress(CONTROLLERBUTTONS_T bitmask, std::string id) { std::shared_ptr mapping = nullptr; - mUseKeydownEventToCreateNewMapping = true; + mUseInputToCreateNewMapping = true; if (mKeyboardScancodeForNewMapping != LUS_KB_UNKNOWN) { mapping = std::make_shared(mPortIndex, bitmask, mKeyboardScancodeForNewMapping); } else if (!Context::GetInstance()->GetWindow()->GetGui()->IsMouseOverAnyGuiItem() && @@ -194,7 +194,7 @@ bool ControllerButton::AddOrEditButtonMappingFromRawPress(CONTROLLERBUTTONS_T bi mKeyboardScancodeForNewMapping = LUS_KB_UNKNOWN; mMouseButtonForNewMapping = LUS_MOUSE_BTN_UNKNOWN; - mUseKeydownEventToCreateNewMapping = false; + mUseInputToCreateNewMapping = false; if (id != "") { ClearButtonMapping(id); @@ -211,7 +211,7 @@ bool ControllerButton::AddOrEditButtonMappingFromRawPress(CONTROLLERBUTTONS_T bi } bool ControllerButton::ProcessKeyboardEvent(KbEventType eventType, KbScancode scancode) { - if (mUseKeydownEventToCreateNewMapping) { + if (mUseInputToCreateNewMapping) { if (eventType == LUS_KB_EVENT_KEY_DOWN) { mKeyboardScancodeForNewMapping = scancode; return true; @@ -234,7 +234,7 @@ bool ControllerButton::ProcessKeyboardEvent(KbEventType eventType, KbScancode sc } bool ControllerButton::ProcessMouseEvent(bool isPressed, MouseBtn button) { - if (mUseKeydownEventToCreateNewMapping) { + if (mUseInputToCreateNewMapping) { if (isPressed) { mMouseButtonForNewMapping = button; return true; diff --git a/src/controller/controldevice/controller/ControllerButton.h b/src/controller/controldevice/controller/ControllerButton.h index 0678d3813..d541c76dc 100644 --- a/src/controller/controldevice/controller/ControllerButton.h +++ b/src/controller/controldevice/controller/ControllerButton.h @@ -47,7 +47,7 @@ class ControllerButton { std::unordered_map> mButtonMappings; std::string GetConfigNameFromBitmask(CONTROLLERBUTTONS_T bitmask); - bool mUseKeydownEventToCreateNewMapping; + bool mUseInputToCreateNewMapping; KbScancode mKeyboardScancodeForNewMapping; MouseBtn mMouseButtonForNewMapping; }; diff --git a/src/controller/controldevice/controller/ControllerStick.cpp b/src/controller/controldevice/controller/ControllerStick.cpp index 547779c12..4dcb57ce0 100644 --- a/src/controller/controldevice/controller/ControllerStick.cpp +++ b/src/controller/controldevice/controller/ControllerStick.cpp @@ -25,7 +25,7 @@ namespace Ship { ControllerStick::ControllerStick(uint8_t portIndex, StickIndex stickIndex) - : mPortIndex(portIndex), mStickIndex(stickIndex), mUseKeydownEventToCreateNewMapping(false), + : mPortIndex(portIndex), mStickIndex(stickIndex), mUseInputToCreateNewMapping(false), mKeyboardScancodeForNewMapping(KbScancode::LUS_KB_UNKNOWN), mMouseButtonForNewMapping(LUS_MOUSE_BTN_UNKNOWN) { mSensitivityPercentage = DEFAULT_STICK_SENSITIVITY_PERCENTAGE; mSensitivity = 1.0f; @@ -271,7 +271,7 @@ void ControllerStick::Process(int8_t& x, int8_t& y) { bool ControllerStick::AddOrEditAxisDirectionMappingFromRawPress(Direction direction, std::string id) { std::shared_ptr mapping = nullptr; - mUseKeydownEventToCreateNewMapping = true; + mUseInputToCreateNewMapping = true; if (mKeyboardScancodeForNewMapping != LUS_KB_UNKNOWN) { mapping = std::make_shared(mPortIndex, mStickIndex, direction, mKeyboardScancodeForNewMapping); @@ -290,7 +290,7 @@ bool ControllerStick::AddOrEditAxisDirectionMappingFromRawPress(Direction direct mKeyboardScancodeForNewMapping = LUS_KB_UNKNOWN; mMouseButtonForNewMapping = LUS_MOUSE_BTN_UNKNOWN; - mUseKeydownEventToCreateNewMapping = false; + mUseInputToCreateNewMapping = false; if (id != "") { ClearAxisDirectionMapping(direction, id); @@ -325,7 +325,7 @@ void ControllerStick::UpdatePad(int8_t& x, int8_t& y) { } bool ControllerStick::ProcessKeyboardEvent(KbEventType eventType, KbScancode scancode) { - if (mUseKeydownEventToCreateNewMapping) { + if (mUseInputToCreateNewMapping) { if (eventType == LUS_KB_EVENT_KEY_DOWN) { mKeyboardScancodeForNewMapping = scancode; return true; @@ -350,7 +350,7 @@ bool ControllerStick::ProcessKeyboardEvent(KbEventType eventType, KbScancode sca } bool ControllerStick::ProcessMouseEvent(bool isPressed, MouseBtn button) { - if (mUseKeydownEventToCreateNewMapping) { + if (mUseInputToCreateNewMapping) { if (isPressed) { mMouseButtonForNewMapping = button; return true; diff --git a/src/controller/controldevice/controller/ControllerStick.h b/src/controller/controldevice/controller/ControllerStick.h index 806aeb4c9..ea0283ba3 100644 --- a/src/controller/controldevice/controller/ControllerStick.h +++ b/src/controller/controldevice/controller/ControllerStick.h @@ -76,7 +76,7 @@ class ControllerStick { std::unordered_map>> mAxisDirectionMappings; - bool mUseKeydownEventToCreateNewMapping; + bool mUseInputToCreateNewMapping; KbScancode mKeyboardScancodeForNewMapping; MouseBtn mMouseButtonForNewMapping; };