Merge pull request #210 from ignac/master

Fix #204 modifier keys not working in remote desktop on MacOS
This commit is contained in:
Adrian Lucrèce Céleste 2018-12-30 14:50:17 -05:00 committed by GitHub
commit 4afe5ddf87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -521,19 +521,19 @@ OSXKeyState::postHIDVirtualKey(const UInt8 virtualKeyCode,
switch (virtualKeyCode) switch (virtualKeyCode)
{ {
case s_shiftVK: case s_shiftVK:
modifiersDelta = NX_SHIFTMASK; modifiersDelta = NX_SHIFTMASK | NX_DEVICELSHIFTKEYMASK;
m_shiftPressed = postDown; m_shiftPressed = postDown;
break; break;
case s_superVK: case s_superVK:
modifiersDelta = NX_COMMANDMASK; modifiersDelta = NX_COMMANDMASK | NX_DEVICELCMDKEYMASK;
m_superPressed = postDown; m_superPressed = postDown;
break; break;
case s_altVK: case s_altVK:
modifiersDelta = NX_ALTERNATEMASK; modifiersDelta = NX_ALTERNATEMASK | NX_DEVICELALTKEYMASK;
m_altPressed = postDown; m_altPressed = postDown;
break; break;
case s_controlVK: case s_controlVK:
modifiersDelta = NX_CONTROLMASK; modifiersDelta = NX_CONTROLMASK | NX_DEVICELCTLKEYMASK;
m_controlPressed = postDown; m_controlPressed = postDown;
break; break;
case s_capsLockVK: case s_capsLockVK:
@ -551,6 +551,7 @@ OSXKeyState::postHIDVirtualKey(const UInt8 virtualKeyCode,
} }
kern_return_t kr; kern_return_t kr;
event.key.keyCode = virtualKeyCode;
kr = IOHIDPostEvent(getEventDriver(), NX_FLAGSCHANGED, loc, kr = IOHIDPostEvent(getEventDriver(), NX_FLAGSCHANGED, loc,
&event, kNXEventDataVersion, modifiers, true); &event, kNXEventDataVersion, modifiers, true);
assert(KERN_SUCCESS == kr); assert(KERN_SUCCESS == kr);