WiimoteEmu/UDrawTablet: Expose mapping for lifted stylus.

This commit is contained in:
Jordan Woyak 2022-12-22 17:12:13 -06:00
parent e0fba20f1f
commit ab9fc3f2e4
1 changed files with 4 additions and 4 deletions

View File

@ -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();