cocoa: fix scroll wheel input with Shift modifier

holding shift swaps the scroll wheel axes and deltaY returned zero.
summing up deltaX and deltaY will always give us the right button.

Fixes #3506
This commit is contained in:
Akemi 2017-02-18 03:48:25 +01:00
parent f9369750b1
commit 3064bbe1dd
1 changed files with 2 additions and 1 deletions

View File

@ -266,7 +266,8 @@
[self preciseScroll:event];
} else {
const int modifiers = [event modifierFlags];
const int mpkey = [event deltaY] > 0 ? MP_MOUSE_BTN3 : MP_MOUSE_BTN4;
const int mpkey = ([event deltaX] + [event deltaY]) > 0 ?
MP_MOUSE_BTN3 : MP_MOUSE_BTN4;
[self.adapter putKey:mpkey withModifiers:modifiers];
}
}