mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 12:12:16 +00:00
Support smooth scrolling on Snow Leopard
This commit is contained in:
parent
5cf8587269
commit
cb0089b839
@ -29,6 +29,11 @@
|
|||||||
// Needed for _NSGetProgname
|
// Needed for _NSGetProgname
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
|
|
||||||
|
@interface NSEvent (DeviceDelta)
|
||||||
|
- (bool)_continuousScroll;
|
||||||
|
- (CGFloat)deviceDeltaX;
|
||||||
|
- (CGFloat)deviceDeltaY;
|
||||||
|
@end
|
||||||
|
|
||||||
// Enter fullscreen mode
|
// Enter fullscreen mode
|
||||||
//
|
//
|
||||||
@ -616,10 +621,18 @@ static int translateKey(unsigned int key)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||||
|
{
|
||||||
|
if ([event _continuousScroll])
|
||||||
|
{
|
||||||
|
deltaX = [event deviceDeltaX] * 0.1;
|
||||||
|
deltaY = [event deviceDeltaY] * 0.1;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
deltaX = [event deltaX];
|
deltaX = [event deltaX];
|
||||||
deltaY = [event deltaY];
|
deltaY = [event deltaY];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
|
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
|
||||||
_glfwInputScroll(window, deltaX, deltaY);
|
_glfwInputScroll(window, deltaX, deltaY);
|
||||||
|
Loading…
Reference in New Issue
Block a user