Added PubSub notification on mouse events (only triggered in Windows)

This commit is contained in:
Benoit LeBlanc
2014-01-17 18:17:10 -05:00
parent 7964e1c7c8
commit b142bd4e4d
3 changed files with 16 additions and 0 deletions

View File

@@ -31,6 +31,7 @@
#include "wf_gdi.h"
#include "wf_event.h"
#include "freerdp/event.h"
static HWND g_focus_hWnd;
@@ -576,6 +577,8 @@ BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, HDC hdcSr
void wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
int ww, wh, dw, dh;
rdpContext* context;
MouseEventEventArgs eventArgs;
if (!wfc->client_width)
wfc->client_width = wfc->width;
@@ -592,4 +595,10 @@ void wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16
input->MouseEvent(input, flags, x + wfc->xCurrentScroll, y + wfc->yCurrentScroll);
else
input->MouseEvent(input, flags, x * dw / ww + wfc->xCurrentScroll, y * dh / wh + wfc->yCurrentScroll);
eventArgs.flags = flags;
eventArgs.x = x;
eventArgs.y = y;
context = (rdpContext*) wfc;
PubSub_OnMouseEvent(context->pubSub, context, &eventArgs);
}

View File

@@ -83,6 +83,12 @@ DEFINE_EVENT_BEGIN(ChannelDisconnected)
void* pInterface;
DEFINE_EVENT_END(ChannelDisconnected)
DEFINE_EVENT_BEGIN(MouseEvent)
UINT16 flags;
UINT16 x;
UINT16 y;
DEFINE_EVENT_END(MouseEvent)
#ifdef __cplusplus
}
#endif

View File

@@ -368,6 +368,7 @@ static wEventType FreeRDP_Events[] =
DEFINE_EVENT_ENTRY(ConnectionResult)
DEFINE_EVENT_ENTRY(ChannelConnected)
DEFINE_EVENT_ENTRY(ChannelDisconnected)
DEFINE_EVENT_ENTRY(MouseEvent)
};
/** Allocator function for a rdp context.