From e217d6c939900688588f5214ea188f0f505d8a09 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 2 Mar 2025 15:42:26 -0600 Subject: [PATCH] InputCommon: Use Clock from CommonTypes. --- Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp | 2 +- Source/Core/InputCommon/ControllerInterface/CoreDevice.h | 2 -- Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp | 3 +-- Source/Core/InputCommon/ControllerInterface/MappingCommon.h | 4 +--- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp index 05dc5a3f79..f1220ec29e 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp @@ -170,7 +170,7 @@ public: // Ignore the mouse-click that queued this new detection and finalize the current mapping. auto results = m_input_detector->TakeResults(); ciface::MappingCommon::RemoveDetectionsAfterTimePoint( - &results, ciface::Core::DeviceContainer::Clock::now() - INPUT_DETECT_ENDING_IGNORE_TIME); + &results, Clock::now() - INPUT_DETECT_ENDING_IGNORE_TIME); FinalizeMapping(&results); } UpdateInputDetectionStartTimer(); diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h index 92f53df9fa..54d7b46110 100644 --- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h +++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h @@ -210,8 +210,6 @@ public: class DeviceContainer { public: - using Clock = std::chrono::steady_clock; - struct InputDetection { std::shared_ptr device; diff --git a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp index 3765ef24a6..10ebe9a984 100644 --- a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp +++ b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp @@ -147,8 +147,7 @@ void RemoveSpuriousTriggerCombinations(Core::InputDetector::Results* detections) std::erase_if(*detections, is_spurious); } -void RemoveDetectionsAfterTimePoint(Core::InputDetector::Results* results, - Core::DeviceContainer::Clock::time_point after) +void RemoveDetectionsAfterTimePoint(Core::InputDetector::Results* results, Clock::time_point after) { const auto is_after_time = [&](const Core::InputDetector::Detection& detection) { return detection.release_time.value_or(after) >= after; diff --git a/Source/Core/InputCommon/ControllerInterface/MappingCommon.h b/Source/Core/InputCommon/ControllerInterface/MappingCommon.h index f58813a50c..62c1a8f281 100644 --- a/Source/Core/InputCommon/ControllerInterface/MappingCommon.h +++ b/Source/Core/InputCommon/ControllerInterface/MappingCommon.h @@ -4,7 +4,6 @@ #pragma once #include -#include #include "InputCommon/ControllerInterface/CoreDevice.h" @@ -25,8 +24,7 @@ std::string BuildExpression(const Core::InputDetector::Results&, const Core::DeviceQualifier& default_device, Quote quote); void RemoveSpuriousTriggerCombinations(Core::InputDetector::Results*); -void RemoveDetectionsAfterTimePoint(Core::InputDetector::Results*, - Core::DeviceContainer::Clock::time_point after); +void RemoveDetectionsAfterTimePoint(Core::InputDetector::Results*, Clock::time_point after); bool ContainsCompleteDetection(const Core::InputDetector::Results&); } // namespace ciface::MappingCommon