From 0127ce671ba41f8684ffaeb277c7a3bd0bf1a3fb Mon Sep 17 00:00:00 2001 From: SachinVin Date: Sat, 30 May 2020 18:58:34 +0530 Subject: [PATCH] core/frontend/emu_window: return true when TouchPressed is consumed --- src/core/frontend/emu_window.cpp | 5 +++-- src/core/frontend/emu_window.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 73909b09c..3f613a5cb 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -98,9 +98,9 @@ std::tuple EmuWindow::ClipToTouchScreen(unsigned new_x, unsi 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)) - return; + return false; if (Settings::values.render_3d == Settings::StereoRenderOption::SideBySide && framebuffer_x >= framebuffer_layout.width / 2) @@ -126,6 +126,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) { } touch_state->touch_pressed = true; + return true; } void EmuWindow::TouchReleased() { diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index 65ee25bc9..326563655 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h @@ -115,8 +115,9 @@ public: * Signal that a touch pressed event has occurred (e.g. mouse click pressed) * @param framebuffer_x Framebuffer x-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) void TouchReleased();