diff options
Diffstat (limited to 'src/input_common/drivers')
-rw-r--r-- | src/input_common/drivers/mouse.cpp | 17 | ||||
-rw-r--r-- | src/input_common/drivers/mouse.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index 2c2432fb7..1c32b54be 100644 --- a/src/input_common/drivers/mouse.cpp +++ b/src/input_common/drivers/mouse.cpp @@ -121,12 +121,27 @@ void Mouse::StopPanning() { std::vector<Common::ParamPackage> Mouse::GetInputDevices() const { std::vector<Common::ParamPackage> devices; devices.emplace_back(Common::ParamPackage{ - {"engine", "keyboard"}, + {"engine", GetEngineName()}, {"display", "Keyboard/Mouse"}, }); return devices; } +AnalogMapping Mouse::GetAnalogMappingForDevice( + [[maybe_unused]] const Common::ParamPackage& params) { + // Only overwrite different buttons from default + AnalogMapping mapping = {}; + Common::ParamPackage right_analog_params; + right_analog_params.Set("engine", GetEngineName()); + right_analog_params.Set("axis_x", 0); + right_analog_params.Set("axis_y", 1); + right_analog_params.Set("threshold", 0.5f); + right_analog_params.Set("range", 1.0f); + right_analog_params.Set("deadzone", 0.0f); + mapping.insert_or_assign(Settings::NativeAnalog::RStick, std::move(right_analog_params)); + return mapping; +} + std::string Mouse::GetUIName(const Common::ParamPackage& params) const { if (params.Has("button")) { return fmt::format("Mouse {}", params.Get("button", 0)); diff --git a/src/input_common/drivers/mouse.h b/src/input_common/drivers/mouse.h index e8355751a..d3178b1a9 100644 --- a/src/input_common/drivers/mouse.h +++ b/src/input_common/drivers/mouse.h @@ -55,6 +55,7 @@ public: void ReleaseAllButtons(); std::vector<Common::ParamPackage> GetInputDevices() const override; + AnalogMapping GetAnalogMappingForDevice(const Common::ParamPackage& params) override; std::string GetUIName(const Common::ParamPackage& params) const override; private: |