core/frontend/emu_window: return true when TouchPressed is consumed

This commit is contained in:
SachinVin 2020-05-30 18:58:34 +05:30 committed by xperia64
parent a268b6b77e
commit 0127ce671b
2 changed files with 5 additions and 3 deletions

View File

@ -98,9 +98,9 @@ std::tuple<unsigned, unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsi
return std::make_tuple(new_x, new_y); return std::make_tuple(new_x, new_y);
} }
void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) { bool EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) {
if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y))
return; return false;
if (Settings::values.render_3d == Settings::StereoRenderOption::SideBySide && if (Settings::values.render_3d == Settings::StereoRenderOption::SideBySide &&
framebuffer_x >= framebuffer_layout.width / 2) framebuffer_x >= framebuffer_layout.width / 2)
@ -126,6 +126,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) {
} }
touch_state->touch_pressed = true; touch_state->touch_pressed = true;
return true;
} }
void EmuWindow::TouchReleased() { void EmuWindow::TouchReleased() {

View File

@ -115,8 +115,9 @@ public:
* Signal that a touch pressed event has occurred (e.g. mouse click pressed) * Signal that a touch pressed event has occurred (e.g. mouse click pressed)
* @param framebuffer_x Framebuffer x-coordinate that was pressed * @param framebuffer_x Framebuffer x-coordinate that was pressed
* @param framebuffer_y Framebuffer y-coordinate that was pressed * @param framebuffer_y Framebuffer y-coordinate that was pressed
* @returns True if the coordinates are within the touchpad, otherwise false
*/ */
void TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y); bool TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y);
/// Signal that a touch released event has occurred (e.g. mouse click released) /// Signal that a touch released event has occurred (e.g. mouse click released)
void TouchReleased(); void TouchReleased();