Skip to content

Commit

Permalink
Vita: implement mousewheel and buttons 4/5
Browse files Browse the repository at this point in the history
  • Loading branch information
isage authored and slouken committed Nov 27, 2024
1 parent b8bbd29 commit b8233af
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/video/vita/SDL_vitamouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,28 @@ void VITA_PollMouse(void)
else
SDL_SendMouseButton(0, Vita_Window, mouseID, SDL_BUTTON_MIDDLE, true);
}
if (changed_buttons & 0x8) {
if (prev_buttons & 0x8)
SDL_SendMouseButton(0, Vita_Window, mouseID, SDL_BUTTON_X1, false);
else
SDL_SendMouseButton(0, Vita_Window, mouseID, SDL_BUTTON_X1, true);
}
if (changed_buttons & 0x10) {
if (prev_buttons & 0x10)
SDL_SendMouseButton(0, Vita_Window, mouseID, SDL_BUTTON_X2, false);
else
SDL_SendMouseButton(0, Vita_Window, mouseID, SDL_BUTTON_X2, true);
}

prev_buttons = m_reports[i].buttons;

if (m_reports[i].rel_x || m_reports[i].rel_y) {
SDL_SendMouseMotion(0, Vita_Window, mouseID, true, (float)m_reports[i].rel_x, (float)m_reports[i].rel_y);
}

if (m_reports[i].tilt != 0 || m_reports[i].wheel != 0) {
SDL_SendMouseWheel(0, Vita_Window, mouseID, m_reports[i].tilt, m_reports[i].wheel, SDL_MOUSEWHEEL_NORMAL);
}
}
}
}
Expand Down

0 comments on commit b8233af

Please sign in to comment.