diff --git a/src/spice2x/cfg/analog.h b/src/spice2x/cfg/analog.h index 16c8f80..ce35445 100644 --- a/src/spice2x/cfg/analog.h +++ b/src/spice2x/cfg/analog.h @@ -82,18 +82,23 @@ public: return this->index != 0xFF; } - inline void clearBindings() { - device_identifier = ""; - index = 0xFF; + inline void resetValues() { setSensitivity(1.f); setDeadzone(0.f); invert = false; smoothing = false; + deadzone_mirror = false; setMultiplier(1); setRelativeMode(false); setDelayBufferDepth(0); } + inline void clearBindings() { + device_identifier = ""; + index = 0xFF; + resetValues(); + } + inline const std::string &getName() const { return this->name; } diff --git a/src/spice2x/overlay/windows/config.cpp b/src/spice2x/overlay/windows/config.cpp index 7e43b07..27ea2d9 100644 --- a/src/spice2x/overlay/windows/config.cpp +++ b/src/spice2x/overlay/windows/config.cpp @@ -1727,6 +1727,13 @@ namespace overlay::windows { std::vector analogs_midi_indices; if (this->analogs_devices_selected >= 0) { auto device = this->analogs_devices.at(this->analogs_devices_selected); + + // add a tooltip to devices selector + if (!device->name.empty()) { + ImGui::SameLine(); + ImGui::HelpMarker(device->name.c_str()); + } + switch (device->type) { case rawinput::MOUSE: { @@ -2036,6 +2043,11 @@ namespace overlay::windows { ImGui::CloseCurrentPopup(); } + ImGui::SameLine(); + if (ImGui::Button("Reset")) { + analog.resetValues(); + } + // clean up ImGui::EndPopup(); }