1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-20 18:28:01 +00:00

mac: fix reporting of left wheel and right wheel scrolling

left wheel and right wheel was swapped. this was copied from the old
cocoa backend. a delta <0 is a right scroll, >0 is a left scroll.

Fixes #12899
This commit is contained in:
der richter 2023-11-20 16:17:47 +01:00
parent bcdc5c40e7
commit 947800ceb8

View File

@ -224,7 +224,7 @@ class View: NSView {
cmd = delta > 0 ? SWIFT_WHEEL_UP : SWIFT_WHEEL_DOWN
} else {
delta = Double(event.deltaX) * 0.1
cmd = delta > 0 ? SWIFT_WHEEL_RIGHT : SWIFT_WHEEL_LEFT
cmd = delta > 0 ? SWIFT_WHEEL_LEFT : SWIFT_WHEEL_RIGHT
}
mpv?.putAxis(cmd, delta: abs(delta))
@ -246,7 +246,7 @@ class View: NSView {
if abs(deltaY) >= abs(deltaX) {
mpkey = deltaY > 0 ? SWIFT_WHEEL_UP : SWIFT_WHEEL_DOWN
} else {
mpkey = deltaX > 0 ? SWIFT_WHEEL_RIGHT : SWIFT_WHEEL_LEFT
mpkey = deltaX > 0 ? SWIFT_WHEEL_LEFT : SWIFT_WHEEL_RIGHT
}
cocoa_put_key_with_modifiers(mpkey, Int32(modifiers.rawValue))