summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-02-04 19:06:17 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-02-04 19:06:17 +0100
commit85d9f72b8ad92a3e58449af27679c306128d3cb6 (patch)
tree75b884fad9458ba36cbd0bf209f65537d20d472f /platform/osx
parent6ea0863ed3e836127cfd38587a50679d40ca40bc (diff)
parentdf4faf8f334c5b1c71bfcec25fb64caf933b294b (diff)
Merge pull request #3585 from Hinsbart/hscroll
support horizontal mouse wheel
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/os_osx.mm15
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 2bb35fdc60..d808fb67a2 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -809,6 +809,21 @@ static int translateKey(unsigned int key)
OS_OSX::singleton->push_input(ev);
}
+ if (fabs(deltaX)) {
+
+ InputEvent ev;
+ ev.type=InputEvent::MOUSE_BUTTON;
+ ev.mouse_button.button_index=deltaX >0 ? BUTTON_WHEEL_RIGHT : BUTTON_WHEEL_LEFT;
+ ev.mouse_button.pressed=true;
+ ev.mouse_button.x=mouse_x;
+ ev.mouse_button.y=mouse_y;
+ ev.mouse_button.global_x=mouse_x;
+ ev.mouse_button.global_y=mouse_y;
+ ev.mouse_button.button_mask=button_mask;
+ OS_OSX::singleton->push_input(ev);
+ ev.mouse_button.pressed=false;
+ OS_OSX::singleton->push_input(ev);
+ }
}
@end