input: add horizontal mouse scroll/tilt to mouse handlers

This commit is contained in:
Megamouse 2024-05-20 09:58:09 +02:00
parent bf85902485
commit 1600ca2c03
4 changed files with 29 additions and 19 deletions

View file

@ -143,17 +143,15 @@ void raw_mouse::update_values(const RAWMOUSE& state)
get_button_pressed(CELL_MOUSE_BUTTON_4, state.usButtonFlags);
get_button_pressed(CELL_MOUSE_BUTTON_5, state.usButtonFlags);
// Get vertical mouse wheel
// Get mouse wheel
if ((state.usButtonFlags & RI_MOUSE_WHEEL))
{
m_handler->Scroll(m_index, static_cast<s16>(state.usButtonData));
m_handler->Scroll(m_index, 0, std::clamp(static_cast<s16>(state.usButtonData) / WHEEL_DELTA, -128, 127));
}
else if ((state.usButtonFlags & RI_MOUSE_HWHEEL))
{
m_handler->Scroll(m_index, std::clamp(static_cast<s16>(state.usButtonData) / WHEEL_DELTA, -128, 127), 0);
}
// Get horizontal mouse wheel. Ignored until needed.
//if ((state.usButtonFlags & RI_MOUSE_HWHEEL))
//{
// m_handler->Scroll(m_index, static_cast<s16>(state.usButtonData));
//}
// Get mouse movement
if ((state.usFlags & MOUSE_MOVE_ABSOLUTE))