mfreerdp-server: support 3 button mouse dragging

This commit is contained in:
C-o-r-E
2013-02-22 13:01:31 -05:00
parent 5fea599d60
commit 9c459130d6
3 changed files with 30 additions and 24 deletions

View File

@@ -104,8 +104,23 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
if (flags & PTR_FLAGS_MOVE)
{
if (mfi->mouse_down_left == TRUE)
{
mouseType = kCGEventLeftMouseDragged;
}
else if (mfi->mouse_down_right == TRUE)
{
mouseType = kCGEventRightMouseDragged;
}
else if (mfi->mouse_down_other == TRUE)
{
mouseType = kCGEventOtherMouseDragged;
}
else
{
mouseType = kCGEventMouseMoved;
}
mouseType = kCGEventMouseMoved;
CGEventRef move = CGEventCreateMouseEvent(NULL,
mouseType,
CGPointMake(x, y),
@@ -121,10 +136,15 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
mouseButton = kCGMouseButtonLeft;
if (flags & PTR_FLAGS_DOWN)
{
mouseType = kCGEventLeftMouseDown;
mfi->mouse_down = TRUE;
}
else
{
mouseType = kCGEventLeftMouseUp;
mfi->mouse_down = FALSE;
}
}
else if (flags & PTR_FLAGS_BUTTON2)
{
@@ -144,11 +164,7 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
mouseType = kCGEventOtherMouseUp;
}
/*else
{
return;
}
*/
CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL,
mouseType,

View File

@@ -83,34 +83,20 @@ struct mf_info
UINT32 servscreen_xoffset;
UINT32 servscreen_yoffset;
//int frame_idx;
int bitsPerPixel;
//HDC driverDC;
int peerCount;
int activePeerCount;
//void* changeBuffer;
int framesPerSecond;
//LPTSTR deviceKey;
//TCHAR deviceName[32];
freerdp_peer** peers;
//BOOL mirrorDriverActive;
unsigned int framesWaiting;
UINT32 scale;
//HANDLE snd_mutex;
//BOOL snd_stop;
RFX_RECT invalid;
pthread_mutex_t mutex;
//BOOL updatePending;
//HANDLE updateEvent;
//HANDLE updateThread;
//HANDLE updateSemaphore;
//RFX_CONTEXT* rfx_context;
//unsigned long lastUpdate;
//unsigned long nextUpdate;
//SURFACE_BITS_COMMAND cmd;
BOOL mouse_down_left;
BOOL mouse_down_right;
BOOL mouse_down_other;
BOOL input_disabled;
BOOL force_all_disconnect;
};

View File

@@ -289,6 +289,10 @@ BOOL mf_peer_post_connect(freerdp_peer* client)
client->update->DesktopResize(client->update->context);
mfi->mouse_down_left = FALSE;
mfi->mouse_down_right = FALSE;
mfi->mouse_down_other = FALSE;
//#ifdef WITH_SERVER_CHANNELS
/* Iterate all channel names requested by the client and activate those supported by the server */