mirror of https://github.com/mosra/magnum.git
Browse Source
The original implementation tried to mimic the behavior of GLUT, which treats mouse wheel as a button. SDL2, GLFW and NaCl all treat scroll event separately, so it was quite nastily hacked in, with horizontal scrolling ignored and scrolling offset treated as cursor position. Moreover, wheel up/down buttons were confused with extra mouse buttons in SDL2. Now there is a dedicated MouseScrollEvent, which has just the offset and modifiers, no cursor position. The original way with WheelUp/WheelDown buttons in mouse press event is still preserved, though it is marked as deprecated and will be removed in future release. Sdl2Application had WheelUp/WheelDown buttons also for mouse move event, which was completely useless (try moving a mouse while the wheel is rotating, ha), so it's removed. Scroll event offset is now also consistently Vector2 across all toolkits -- it was integer in SDL2, float in NaCl and double in GLFW. The X1 and X2 buttons in Sdl2Application are not confused with wheel up/down anymore and are a new Mouse*Event::Button::X1 and Mouse*Event::Button::X2 enums -- on my mouse they are actually wheel left and wheel right (though wheel left and wheel right is not treated as horizontal scrolling, weird).pull/158/head
6 changed files with 175 additions and 35 deletions
Loading…
Reference in new issue