mfreerdp-server: changed session events to HID events

This commit is contained in:
C-o-r-E 2013-02-28 16:42:40 -05:00
parent 3af61af2ce
commit 7a92b878f5

View File

@ -291,7 +291,7 @@ static const CGKeyCode keymap[256] = {
void mf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) void mf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{ {
CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateCombinedSessionState); CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateHIDSystemState);
BOOL keyDown = TRUE; BOOL keyDown = TRUE;
CGEventRef kbEvent; CGEventRef kbEvent;
@ -352,7 +352,7 @@ void mf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
} }
kbEvent = CGEventCreateKeyboardEvent(source, kCode, keyDown); kbEvent = CGEventCreateKeyboardEvent(source, kCode, keyDown);
CGEventPost(kCGSessionEventTap, kbEvent); CGEventPost(kCGHIDEventTap, kbEvent);
CFRelease(kbEvent); CFRelease(kbEvent);
CFRelease(source); CFRelease(source);
@ -403,7 +403,7 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
scroll_y = (flags & WheelRotationMask) / 120; scroll_y = (flags & WheelRotationMask) / 120;
} }
CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateCombinedSessionState); CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateHIDSystemState);
CGEventRef scroll = CGEventCreateScrollWheelEvent(source, CGEventRef scroll = CGEventCreateScrollWheelEvent(source,
kCGScrollEventUnitLine, kCGScrollEventUnitLine,
wheelCount, wheelCount,
@ -446,7 +446,7 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{ {
mfInfo * mfi; mfInfo * mfi;
CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateCombinedSessionState); CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateHIDSystemState);
CGEventType mouseType = kCGEventNull; CGEventType mouseType = kCGEventNull;
CGMouseButton mouseButton = kCGMouseButtonLeft; CGMouseButton mouseButton = kCGMouseButtonLeft;
@ -541,7 +541,7 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
CGPointMake(x, y), CGPointMake(x, y),
mouseButton mouseButton
); );
CGEventPost(kCGSessionEventTap, mouseEvent); CGEventPost(kCGHIDEventTap, mouseEvent);
CFRelease(mouseEvent); CFRelease(mouseEvent);
CFRelease(source); CFRelease(source);