mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-03-04 22:57:14 +00:00
Don't capture the cursor on a touch event
This commit is contained in:
parent
8cf7f3ac08
commit
0892f0b0bb
1 changed files with 11 additions and 13 deletions
|
@ -612,25 +612,23 @@ void SdlInputHandler::handleMouseButtonEvent(SDL_MouseButtonEvent* event)
|
|||
{
|
||||
int button;
|
||||
|
||||
// Capture the mouse again if clicked when unbound.
|
||||
// We start capture on left button released instead of
|
||||
// pressed to avoid sending an errant mouse button released
|
||||
// event to the host when clicking into our window (since
|
||||
// the pressed event was consumed by this code).
|
||||
if (event->button == SDL_BUTTON_LEFT &&
|
||||
event->state == SDL_RELEASED &&
|
||||
!isCaptureActive()) {
|
||||
setCaptureActive(true);
|
||||
if (event->which == SDL_TOUCH_MOUSEID) {
|
||||
// Ignore synthetic mouse events
|
||||
return;
|
||||
}
|
||||
else if (!isCaptureActive()) {
|
||||
if (event->button == SDL_BUTTON_LEFT && event->state == SDL_RELEASED) {
|
||||
// Capture the mouse again if clicked when unbound.
|
||||
// We start capture on left button released instead of
|
||||
// pressed to avoid sending an errant mouse button released
|
||||
// event to the host when clicking into our window (since
|
||||
// the pressed event was consumed by this code).
|
||||
setCaptureActive(true);
|
||||
}
|
||||
|
||||
// Not capturing
|
||||
return;
|
||||
}
|
||||
else if (event->which == SDL_TOUCH_MOUSEID) {
|
||||
// Ignore synthetic mouse events
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event->button)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue