Support smooth scrolling on Snow Leopard

This commit is contained in:
Patrick Walton 2013-09-12 19:09:03 -07:00
parent 5cf8587269
commit cb0089b839

View File

@ -29,6 +29,11 @@
// Needed for _NSGetProgname
#include <crt_externs.h>
@interface NSEvent (DeviceDelta)
- (bool)_continuousScroll;
- (CGFloat)deviceDeltaX;
- (CGFloat)deviceDeltaY;
@end
// Enter fullscreen mode
//
@ -617,8 +622,16 @@ static int translateKey(unsigned int key)
else
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
{
deltaX = [event deltaX];
deltaY = [event deltaY];
if ([event _continuousScroll])
{
deltaX = [event deviceDeltaX] * 0.1;
deltaY = [event deviceDeltaY] * 0.1;
}
else
{
deltaX = [event deltaX];
deltaY = [event deltaY];
}
}
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)