mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] added support for spice side/extra buttons
Note, QEMU must have support for these new buttons for this to have any effect.
This commit is contained in:
parent
58dd352def
commit
dea7177d29
@ -1154,32 +1154,37 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
|
{
|
||||||
if (state.ignoreInput || !params.useSpiceInput || !state.cursorInView)
|
if (state.ignoreInput || !params.useSpiceInput || !state.cursorInView)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// The SPICE protocol doesn't support more than a standard PS/2 3 button mouse
|
int button = event->button.button;
|
||||||
if (event->button.button > 3)
|
if (button > 3)
|
||||||
break;
|
button += 2;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!spice_mouse_position(event->button.x, event->button.y) ||
|
!spice_mouse_position(event->button.x, event->button.y) ||
|
||||||
!spice_mouse_press(event->button.button)
|
!spice_mouse_press(button)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("SDL_MOUSEBUTTONDOWN: failed to send message");
|
DEBUG_ERROR("SDL_MOUSEBUTTONDOWN: failed to send message");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
|
{
|
||||||
if (state.ignoreInput || !params.useSpiceInput || !state.cursorInView)
|
if (state.ignoreInput || !params.useSpiceInput || !state.cursorInView)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// The SPICE protocol doesn't support more than a standard PS/2 3 button mouse
|
int button = event->button.button;
|
||||||
if (event->button.button > 3)
|
if (button > 3)
|
||||||
break;
|
button += 2;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!spice_mouse_position(event->button.x, event->button.y) ||
|
!spice_mouse_position(event->button.x, event->button.y) ||
|
||||||
!spice_mouse_release(event->button.button)
|
!spice_mouse_release(button)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("SDL_MOUSEBUTTONUP: failed to send message");
|
DEBUG_ERROR("SDL_MOUSEBUTTONUP: failed to send message");
|
||||||
@ -1187,6 +1192,7 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// consume all events
|
// consume all events
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 35ecd45b0e441a6da2be1069a902985ae33570a1
|
Subproject commit 9381dde5ecc0787594aec32d3e1aa974c8532657
|
Loading…
Reference in New Issue
Block a user