Fix #204 modifier keys not working in remote desktop on MacOS

This commit is contained in:
Moron 2018-12-28 17:26:51 +01:00
parent 3d835ea4aa
commit 03f9009d10
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);