SYNERGY-1247 CapsLock doesn't work on Microsoft Remote Desktop
This commit is contained in:
parent
34b6fe6018
commit
5619ed2473
2 changed files with 46 additions and 8 deletions
|
|
@ -476,31 +476,67 @@ OSXKeyState::getKeyMap(synergy::KeyMap& keyMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
CGEventFlags
|
CGEventFlags
|
||||||
OSXKeyState::getKeyboardEventFlags()
|
OSXKeyState::getDeviceIndependedFlags() const
|
||||||
{
|
{
|
||||||
// set the event flags for special keys
|
|
||||||
// http://tinyurl.com/pxl742y
|
|
||||||
CGEventFlags modifiers = 0;
|
CGEventFlags modifiers = 0;
|
||||||
|
|
||||||
if (m_shiftPressed) {
|
if (m_shiftPressed) {
|
||||||
modifiers |= kCGEventFlagMaskShift | NX_DEVICELSHIFTKEYMASK;
|
modifiers |= kCGEventFlagMaskShift;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_controlPressed) {
|
if (m_controlPressed) {
|
||||||
modifiers |= kCGEventFlagMaskControl | NX_DEVICELCTLKEYMASK;
|
modifiers |= kCGEventFlagMaskControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_altPressed) {
|
if (m_altPressed) {
|
||||||
modifiers |= kCGEventFlagMaskAlternate | NX_DEVICELALTKEYMASK;
|
modifiers |= kCGEventFlagMaskAlternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_superPressed) {
|
if (m_superPressed) {
|
||||||
modifiers |= kCGEventFlagMaskCommand | NX_DEVICELCMDKEYMASK;
|
modifiers |= kCGEventFlagMaskCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return modifiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGEventFlags
|
||||||
|
OSXKeyState::getDeviceDependedFlags() const
|
||||||
|
{
|
||||||
|
CGEventFlags modifiers = 0;
|
||||||
|
|
||||||
|
if (m_shiftPressed) {
|
||||||
|
modifiers |= NX_DEVICELSHIFTKEYMASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_controlPressed) {
|
||||||
|
modifiers |= NX_DEVICELCTLKEYMASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_altPressed) {
|
||||||
|
modifiers |= NX_DEVICELALTKEYMASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_superPressed) {
|
||||||
|
modifiers |= NX_DEVICELCMDKEYMASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return modifiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CGEventFlags
|
||||||
|
OSXKeyState::getKeyboardEventFlags() const
|
||||||
|
{
|
||||||
|
// set the event flags for special keys
|
||||||
|
// http://tinyurl.com/pxl742y
|
||||||
|
CGEventFlags modifiers = getDeviceIndependedFlags();
|
||||||
|
|
||||||
if (m_capsPressed) {
|
if (m_capsPressed) {
|
||||||
modifiers |= kCGEventFlagMaskAlphaShift;
|
modifiers |= kCGEventFlagMaskAlphaShift;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
modifiers |= getDeviceDependedFlags();
|
||||||
|
}
|
||||||
|
|
||||||
return modifiers;
|
return modifiers;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,9 @@ private:
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
// Get keyboard event flags accorfing to keyboard modifiers
|
// Get keyboard event flags accorfing to keyboard modifiers
|
||||||
CGEventFlags getKeyboardEventFlags();
|
CGEventFlags getKeyboardEventFlags() const;
|
||||||
|
CGEventFlags getDeviceIndependedFlags() const;
|
||||||
|
CGEventFlags getDeviceDependedFlags() const;
|
||||||
|
|
||||||
void setKeyboardModifiers(CGKeyCode virtualKey, bool keyDown);
|
void setKeyboardModifiers(CGKeyCode virtualKey, bool keyDown);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue