Skip to content

Commit 6428cee

Browse files
isageslouken
authored andcommitted
Vita: implement mousewheel and buttons 4/5
1 parent b64540d commit 6428cee

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: src/video/vita/SDL_vitamouse.c

+16
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,28 @@ void VITA_PollMouse(void)
7373
else
7474
SDL_SendMouseButton(Vita_Window, 0, SDL_PRESSED, SDL_BUTTON_MIDDLE);
7575
}
76+
if (changed_buttons & 0x8) {
77+
if (prev_buttons & 0x8)
78+
SDL_SendMouseButton(Vita_Window, 0, SDL_RELEASED, SDL_BUTTON_X1);
79+
else
80+
SDL_SendMouseButton(Vita_Window, 0, SDL_PRESSED, SDL_BUTTON_X1);
81+
}
82+
if (changed_buttons & 0x10) {
83+
if (prev_buttons & 0x10)
84+
SDL_SendMouseButton(Vita_Window, 0, SDL_RELEASED, SDL_BUTTON_X2);
85+
else
86+
SDL_SendMouseButton(Vita_Window, 0, SDL_PRESSED, SDL_BUTTON_X2);
87+
}
7688

7789
prev_buttons = m_reports[i].buttons;
7890

7991
if (m_reports[i].rel_x || m_reports[i].rel_y) {
8092
SDL_SendMouseMotion(Vita_Window, 0, 1, m_reports[i].rel_x, m_reports[i].rel_y);
8193
}
94+
95+
if (m_reports[i].tilt != 0 || m_reports[i].wheel != 0) {
96+
SDL_SendMouseWheel(Vita_Window, 0, m_reports[i].tilt, m_reports[i].wheel, SDL_MOUSEWHEEL_NORMAL);
97+
}
8298
}
8399
}
84100
}

0 commit comments

Comments
 (0)