summaryrefslogtreecommitdiff
path: root/platform/osx/os_osx.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r--platform/osx/os_osx.mm28
1 files changed, 22 insertions, 6 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 4ece1e0325..41a19ac992 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -625,10 +625,18 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
- (void)otherMouseDown:(NSEvent *)event {
- if ((int)[event buttonNumber] != 2)
- return;
+ if ((int)[event buttonNumber] == 2) {
+ _mouseDownEvent(event, BUTTON_MIDDLE, BUTTON_MASK_MIDDLE, true);
+
+ } else if ((int)[event buttonNumber] == 3) {
+ _mouseDownEvent(event, BUTTON_XBUTTON1, BUTTON_MASK_XBUTTON1, true);
+
+ } else if ((int)[event buttonNumber] == 4) {
+ _mouseDownEvent(event, BUTTON_XBUTTON2, BUTTON_MASK_XBUTTON2, true);
- _mouseDownEvent(event, BUTTON_MIDDLE, BUTTON_MASK_MIDDLE, true);
+ } else {
+ return;
+ }
}
- (void)otherMouseDragged:(NSEvent *)event {
@@ -637,10 +645,18 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
- (void)otherMouseUp:(NSEvent *)event {
- if ((int)[event buttonNumber] != 2)
- return;
+ if ((int)[event buttonNumber] == 2) {
+ _mouseDownEvent(event, BUTTON_MIDDLE, BUTTON_MASK_MIDDLE, false);
+
+ } else if ((int)[event buttonNumber] == 3) {
+ _mouseDownEvent(event, BUTTON_XBUTTON1, BUTTON_MASK_XBUTTON1, false);
+
+ } else if ((int)[event buttonNumber] == 4) {
+ _mouseDownEvent(event, BUTTON_XBUTTON2, BUTTON_MASK_XBUTTON2, false);
- _mouseDownEvent(event, BUTTON_MIDDLE, BUTTON_MASK_MIDDLE, false);
+ } else {
+ return;
+ }
}
- (void)mouseExited:(NSEvent *)event {