From df4faf8f334c5b1c71bfcec25fb64caf933b294b Mon Sep 17 00:00:00 2001 From: hondres Date: Thu, 4 Feb 2016 17:16:22 +0100 Subject: support horizontal mouse wheel, use in text editor --- platform/osx/os_osx.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'platform/osx') 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 -- cgit v1.2.3