summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorhondres <liu.gam3@gmail.com>2016-02-04 17:16:22 +0100
committerhondres <liu.gam3@gmail.com>2016-02-04 17:16:22 +0100
commitdf4faf8f334c5b1c71bfcec25fb64caf933b294b (patch)
treeb1444e53001ee0b7783525dc700d3466aa9b79e9 /platform/osx
parentcefca4429c165134e1acc00bbd58bdcbc3f4f955 (diff)
support horizontal mouse wheel, use in text editor
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