mfreerdp-server: vertical scroll input support
This commit is contained in:
parent
3e24f4e886
commit
c89c8b7419
@ -349,6 +349,10 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
|
|||||||
{
|
{
|
||||||
float width, height;
|
float width, height;
|
||||||
|
|
||||||
|
CGWheelCount wheelCount = 2;
|
||||||
|
UINT32 scroll_x = 0;
|
||||||
|
UINT32 scroll_y = 0;
|
||||||
|
|
||||||
if (flags & PTR_FLAGS_WHEEL)
|
if (flags & PTR_FLAGS_WHEEL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -360,6 +364,27 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
|
|||||||
|
|
||||||
SendInput(1, &mouse_event, sizeof(INPUT));
|
SendInput(1, &mouse_event, sizeof(INPUT));
|
||||||
*/
|
*/
|
||||||
|
scroll_y = flags & WheelRotationMask;
|
||||||
|
|
||||||
|
if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
|
||||||
|
{
|
||||||
|
scroll_y = -(flags & WheelRotationMask) / 392;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scroll_y = (flags & WheelRotationMask) / 120;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateCombinedSessionState);
|
||||||
|
CGEventRef scroll = CGEventCreateScrollWheelEvent(source,
|
||||||
|
kCGScrollEventUnitLine,
|
||||||
|
wheelCount,
|
||||||
|
scroll_y,
|
||||||
|
scroll_x);
|
||||||
|
CGEventPost(kCGHIDEventTap, scroll);
|
||||||
|
|
||||||
|
CFRelease(scroll);
|
||||||
|
CFRelease(source);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user