mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-23 09:43:24 +03:00
Improve precision of grabbed scroll events on OSX server
This is barrier issue #63, synergy issue #5672.
This commit is contained in:
parent
773a0081e3
commit
a645e9a296
@ -144,10 +144,10 @@ private:
|
|||||||
ButtonID mapMacButtonToBarrier(UInt16) const;
|
ButtonID mapMacButtonToBarrier(UInt16) const;
|
||||||
|
|
||||||
// map mac scroll wheel value to a barrier scroll wheel value
|
// map mac scroll wheel value to a barrier scroll wheel value
|
||||||
SInt32 mapScrollWheelToBarrier(SInt32) const;
|
SInt32 mapScrollWheelToBarrier(float) const;
|
||||||
|
|
||||||
// map barrier scroll wheel value to a mac scroll wheel value
|
// map barrier scroll wheel value to a mac scroll wheel value
|
||||||
SInt32 mapScrollWheelFromBarrier(SInt32) const;
|
SInt32 mapScrollWheelFromBarrier(float) const;
|
||||||
|
|
||||||
// get the current scroll wheel speed
|
// get the current scroll wheel speed
|
||||||
double getScrollSpeed() const;
|
double getScrollSpeed() const;
|
||||||
|
@ -1421,7 +1421,7 @@ OSXScreen::mapMacButtonToBarrier(UInt16 macButton) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
SInt32
|
SInt32
|
||||||
OSXScreen::mapScrollWheelToBarrier(SInt32 x) const
|
OSXScreen::mapScrollWheelToBarrier(float x) const
|
||||||
{
|
{
|
||||||
// return accelerated scrolling but not exponentially scaled as it is
|
// return accelerated scrolling but not exponentially scaled as it is
|
||||||
// on the mac.
|
// on the mac.
|
||||||
@ -1430,7 +1430,7 @@ OSXScreen::mapScrollWheelToBarrier(SInt32 x) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
SInt32
|
SInt32
|
||||||
OSXScreen::mapScrollWheelFromBarrier(SInt32 x) const
|
OSXScreen::mapScrollWheelFromBarrier(float x) const
|
||||||
{
|
{
|
||||||
// use server's acceleration with a little boost since other platforms
|
// use server's acceleration with a little boost since other platforms
|
||||||
// take one wheel step as a larger step than the mac does.
|
// take one wheel step as a larger step than the mac does.
|
||||||
@ -1948,9 +1948,9 @@ OSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
|
|||||||
break;
|
break;
|
||||||
case kCGEventScrollWheel:
|
case kCGEventScrollWheel:
|
||||||
screen->onMouseWheel(screen->mapScrollWheelToBarrier(
|
screen->onMouseWheel(screen->mapScrollWheelToBarrier(
|
||||||
CGEventGetIntegerValueField(event, kCGScrollWheelEventDeltaAxis2)),
|
CGEventGetIntegerValueField(event, kCGScrollWheelEventFixedPtDeltaAxis2) / 65536.0f),
|
||||||
screen->mapScrollWheelToBarrier(
|
screen->mapScrollWheelToBarrier(
|
||||||
CGEventGetIntegerValueField(event, kCGScrollWheelEventDeltaAxis1)));
|
CGEventGetIntegerValueField(event, kCGScrollWheelEventFixedPtDeltaAxis1) / 65536.0f));
|
||||||
break;
|
break;
|
||||||
case kCGEventKeyDown:
|
case kCGEventKeyDown:
|
||||||
case kCGEventKeyUp:
|
case kCGEventKeyUp:
|
||||||
|
Loading…
Reference in New Issue
Block a user