diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/out/cocoa/events_view.m | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m index 7a95bb9442..0bf434caf3 100644 --- a/video/out/cocoa/events_view.m +++ b/video/out/cocoa/events_view.m @@ -291,7 +291,7 @@ - (void)putMouseEvent:(NSEvent *)event withState:(int)state { self.hasMouseDown = (state == MP_KEY_STATE_DOWN); - int mpkey = (MP_MOUSE_BASE + [self mpvButtonNumber:event]); + int mpkey = [self mpvButtonNumber:event]; [self.adapter putKey:(mpkey | state) withModifiers:[event modifierFlags]]; } @@ -326,9 +326,12 @@ { int buttonNumber = [event buttonNumber]; switch (buttonNumber) { - case 1: return 2; - case 2: return 1; - default: return buttonNumber; + case 0: return MP_MBTN_LEFT; + case 1: return MP_MBTN_RIGHT; + case 2: return MP_MBTN_MID; + case 3: return MP_MBTN_BACK; + case 4: return MP_MBTN_FORWARD; + default: return MP_MBTN9 - 5 + buttonNumber; } } @end |