From ab9fc3f2e4f3f2a11f1893aec8160956b991b7db Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 22 Dec 2022 17:12:13 -0600 Subject: [PATCH] WiimoteEmu/UDrawTablet: Expose mapping for lifted stylus. --- Source/Core/Core/HW/WiimoteEmu/Extension/UDrawTablet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteEmu/Extension/UDrawTablet.cpp b/Source/Core/Core/HW/WiimoteEmu/Extension/UDrawTablet.cpp index e78d41f015..5531030277 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Extension/UDrawTablet.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Extension/UDrawTablet.cpp @@ -48,6 +48,7 @@ UDrawTablet::UDrawTablet() : Extension3rdParty("uDraw", _trans("uDraw GameTablet // Touch groups.emplace_back(m_touch = new ControllerEmu::Triggers(_trans("Touch"))); m_touch->AddInput(ControllerEmu::Translate, _trans("Pressure")); + m_touch->AddInput(ControllerEmu::Translate, _trans("Lift")); } void UDrawTablet::BuildDesiredExtensionState(DesiredExtensionState* target_state) @@ -78,11 +79,10 @@ void UDrawTablet::BuildDesiredExtensionState(DesiredExtensionState* target_state constexpr double center_y = (max_y + min_y) / 2.0; // Neutral (lifted) stylus state: - u16 stylus_x = 0x7ff; - u16 stylus_y = 0x7ff; + u16 stylus_x = 0xfff; + u16 stylus_y = 0xfff; - // TODO: Expose the lifted stylus state in the UI. - bool is_stylus_lifted = false; + const bool is_stylus_lifted = std::lround(touch_state.data[1]) != 0; const auto stylus_state = m_stylus->GetState();