mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-20 02:57:19 +03:00
Report momentum scrolling status of scroll events on cocoa
This commit is contained in:
parent
fdbd8df7b2
commit
fc5e74e457
@ -923,6 +923,17 @@ - (void)scrollWheel:(NSEvent *)event
|
||||
if (yscale > 0) deltaY *= yscale;
|
||||
}
|
||||
|
||||
switch([event momentumPhase]) {
|
||||
case NSEventPhaseBegan:
|
||||
flags |= (1 << 1); break;
|
||||
case NSEventPhaseChanged:
|
||||
flags |= (2 << 1); break;
|
||||
case NSEventPhaseEnded:
|
||||
flags |= (3 << 1); break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
|
||||
_glfwInputScroll(window, deltaX, deltaY, flags);
|
||||
}
|
||||
|
7
glfw/glfw3.h
vendored
7
glfw/glfw3.h
vendored
@ -1380,7 +1380,12 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
|
||||
* @param[in] window The window that received the event.
|
||||
* @param[in] xoffset The scroll offset along the x-axis.
|
||||
* @param[in] yoffset The scroll offset along the y-axis.
|
||||
* @param[in] flags A bit-mask providing extra data about the event. flags & 1 will be true if and only if the offset values are "high-precision". Typically pixel values. Otherwise the offset values are number of lines.
|
||||
* @param[in] flags A bit-mask providing extra data about the event.
|
||||
* flags & 1 will be true if and only if the offset values are "high-precision".
|
||||
* Typically pixel values. Otherwise the offset values are number of lines.
|
||||
* (flags >> 1) & 3 will have value 1 for start of momentum scrolling,
|
||||
* value 2 for momentum scrolling in progress and value 3 for momentum
|
||||
* scrolling ended.
|
||||
*
|
||||
* @sa @ref scrolling
|
||||
* @sa @ref glfwSetScrollCallback
|
||||
|
Loading…
Reference in New Issue
Block a user