mirror of https://github.com/debauchee/barrier.git
Merge pull request #210 from ignac/master
Fix #204 modifier keys not working in remote desktop on MacOS
This commit is contained in:
commit
4afe5ddf87
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue