mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 04:51:41 +00:00
Extended mouse wheel handling in Cocoa backend
Horizontal scrolling using mouse wheel with Shift keyboard button hold is no longer ignored
This commit is contained in:
parent
14ca635dc1
commit
7c8babceba
1 changed files with 5 additions and 2 deletions
|
@ -680,7 +680,10 @@ void ProcessMouseButtonEvent(NSEvent* theEvent)
|
|||
|
||||
void ProcessMouseWheelEvent(NSEvent* theEvent)
|
||||
{
|
||||
const CGFloat delta = [theEvent deltaY];
|
||||
const SWORD modifiers = ModifierFlagsToGUIKeyModifiers(theEvent);
|
||||
const CGFloat delta = (modifiers & GKM_SHIFT)
|
||||
? [theEvent deltaX]
|
||||
: [theEvent deltaY];
|
||||
const bool isZeroDelta = fabs(delta) < 1.0E-5;
|
||||
|
||||
if (isZeroDelta && GUICapture)
|
||||
|
@ -694,7 +697,7 @@ void ProcessMouseWheelEvent(NSEvent* theEvent)
|
|||
{
|
||||
event.type = EV_GUI_Event;
|
||||
event.subtype = delta > 0.0f ? EV_GUI_WheelUp : EV_GUI_WheelDown;
|
||||
event.data3 = ModifierFlagsToGUIKeyModifiers(theEvent);
|
||||
event.data3 = modifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue