summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2022-12-22 17:12:13 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2022-12-25 19:03:15 -0600
commitab9fc3f2e4f3f2a11f1893aec8160956b991b7db (patch)
treee6c1f8aaabef559321bcd4933dd181dcd9991997 /Source/Core
parente0fba20f1f353a2373b929f739773cd10132e311 (diff)
WiimoteEmu/UDrawTablet: Expose mapping for lifted stylus.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/WiimoteEmu/Extension/UDrawTablet.cpp8
1 files 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();