fix: Send extra mouse buttons on mac os servers to clients
This commit is contained in:
parent
4200de66ee
commit
84e1e722c0
1 changed files with 47 additions and 44 deletions
|
|
@ -1185,9 +1185,13 @@ ButtonID OSXScreen::mapDeskflowButtonToMac(uint16_t button) const
|
||||||
return kMacButtonMiddle;
|
return kMacButtonMiddle;
|
||||||
case 3:
|
case 3:
|
||||||
return kMacButtonRight;
|
return kMacButtonRight;
|
||||||
|
case 4:
|
||||||
|
return kButtonExtra0;
|
||||||
|
case 5:
|
||||||
|
return kButtonExtra1;
|
||||||
|
default:
|
||||||
|
return kButtonNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
return static_cast<ButtonID>(button);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonID OSXScreen::mapMacButtonToDeskflow(uint16_t macButton) const
|
ButtonID OSXScreen::mapMacButtonToDeskflow(uint16_t macButton) const
|
||||||
|
|
@ -1195,15 +1199,17 @@ ButtonID OSXScreen::mapMacButtonToDeskflow(uint16_t macButton) const
|
||||||
switch (macButton) {
|
switch (macButton) {
|
||||||
case 1:
|
case 1:
|
||||||
return kButtonLeft;
|
return kButtonLeft;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
return kButtonRight;
|
return kButtonRight;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
return kButtonMiddle;
|
return kButtonMiddle;
|
||||||
|
case 4:
|
||||||
|
return kButtonExtra0;
|
||||||
|
case 5:
|
||||||
|
return kButtonExtra1;
|
||||||
|
default:
|
||||||
|
return kButtonNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
return static_cast<ButtonID>(macButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t OSXScreen::mapScrollWheelToDeskflow(int32_t x) const
|
int32_t OSXScreen::mapScrollWheelToDeskflow(int32_t x) const
|
||||||
|
|
@ -1519,8 +1525,7 @@ static CGSSetGlobalHotKeyOperatingMode_t s_CGSSetGlobalHotKeyOperatingMode;
|
||||||
s_##name_ = (name_##_t)NSAddressOfSymbol(NSLookupAndBindSymbolWithHint("_" #name_, "CoreGraphics")); \
|
s_##name_ = (name_##_t)NSAddressOfSymbol(NSLookupAndBindSymbolWithHint("_" #name_, "CoreGraphics")); \
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool OSXScreen::isGlobalHotKeyOperatingModeAvailable()
|
||||||
OSXScreen::isGlobalHotKeyOperatingModeAvailable()
|
|
||||||
{
|
{
|
||||||
if (!s_testedForGHOM) {
|
if (!s_testedForGHOM) {
|
||||||
s_testedForGHOM = true;
|
s_testedForGHOM = true;
|
||||||
|
|
@ -1534,8 +1539,7 @@ OSXScreen::isGlobalHotKeyOperatingModeAvailable()
|
||||||
return s_hasGHOM;
|
return s_hasGHOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void OSXScreen::setGlobalHotKeysEnabled(bool enabled)
|
||||||
OSXScreen::setGlobalHotKeysEnabled(bool enabled)
|
|
||||||
{
|
{
|
||||||
if (isGlobalHotKeyOperatingModeAvailable()) {
|
if (isGlobalHotKeyOperatingModeAvailable()) {
|
||||||
CGSConnection conn = s__CGSDefaultConnection();
|
CGSConnection conn = s__CGSDefaultConnection();
|
||||||
|
|
@ -1552,8 +1556,7 @@ OSXScreen::setGlobalHotKeysEnabled(bool enabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool OSXScreen::getGlobalHotKeysEnabled()
|
||||||
OSXScreen::getGlobalHotKeysEnabled()
|
|
||||||
{
|
{
|
||||||
CGSGlobalHotKeyOperatingMode mode;
|
CGSGlobalHotKeyOperatingMode mode;
|
||||||
if (isGlobalHotKeyOperatingModeAvailable()) {
|
if (isGlobalHotKeyOperatingModeAvailable()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue