Remove 'MouseWheelEvent' and adjust usages

This commit is contained in:
Vittorio Romeo 2021-12-09 00:48:03 +00:00
parent d12a2cd319
commit 21d594a765
5 changed files with 5 additions and 39 deletions

View File

@ -99,20 +99,6 @@ public:
int y; //!< Y position of the mouse pointer, relative to the top of the owner window int y; //!< Y position of the mouse pointer, relative to the top of the owner window
}; };
////////////////////////////////////////////////////////////
/// \brief Mouse wheel events parameters (MouseWheelMoved)
///
/// \deprecated This event is deprecated and potentially inaccurate.
/// Use MouseWheelScrollEvent instead.
///
////////////////////////////////////////////////////////////
struct MouseWheelEvent
{
int delta; //!< Number of ticks the wheel has moved (positive is up, negative is down)
int x; //!< X position of the mouse pointer, relative to the left of the owner window
int y; //!< Y position of the mouse pointer, relative to the top of the owner window
};
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Mouse wheel events parameters (MouseWheelScrolled) /// \brief Mouse wheel events parameters (MouseWheelScrolled)
/// ///
@ -193,7 +179,6 @@ public:
TextEntered, //!< A character was entered (data in event.text) TextEntered, //!< A character was entered (data in event.text)
KeyPressed, //!< A key was pressed (data in event.key) KeyPressed, //!< A key was pressed (data in event.key)
KeyReleased, //!< A key was released (data in event.key) KeyReleased, //!< A key was released (data in event.key)
MouseWheelMoved, //!< The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
MouseWheelScrolled, //!< The mouse wheel was scrolled (data in event.mouseWheelScroll) MouseWheelScrolled, //!< The mouse wheel was scrolled (data in event.mouseWheelScroll)
MouseButtonPressed, //!< A mouse button was pressed (data in event.mouseButton) MouseButtonPressed, //!< A mouse button was pressed (data in event.mouseButton)
MouseButtonReleased, //!< A mouse button was released (data in event.mouseButton) MouseButtonReleased, //!< A mouse button was released (data in event.mouseButton)
@ -225,7 +210,6 @@ public:
TextEvent text; //!< Text event parameters (Event::TextEntered) TextEvent text; //!< Text event parameters (Event::TextEntered)
MouseMoveEvent mouseMove; //!< Mouse move event parameters (Event::MouseMoved) MouseMoveEvent mouseMove; //!< Mouse move event parameters (Event::MouseMoved)
MouseButtonEvent mouseButton; //!< Mouse button event parameters (Event::MouseButtonPressed, Event::MouseButtonReleased) MouseButtonEvent mouseButton; //!< Mouse button event parameters (Event::MouseButtonPressed, Event::MouseButtonReleased)
MouseWheelEvent mouseWheel; //!< Mouse wheel event parameters (Event::MouseWheelMoved) (deprecated)
MouseWheelScrollEvent mouseWheelScroll; //!< Mouse wheel event parameters (Event::MouseWheelScrolled) MouseWheelScrollEvent mouseWheelScroll; //!< Mouse wheel event parameters (Event::MouseWheelScrolled)
JoystickMoveEvent joystickMove; //!< Joystick move event parameters (Event::JoystickMoved) JoystickMoveEvent joystickMove; //!< Joystick move event parameters (Event::JoystickMoved)
JoystickButtonEvent joystickButton; //!< Joystick button event parameters (Event::JoystickButtonPressed, Event::JoystickButtonReleased) JoystickButtonEvent joystickButton; //!< Joystick button event parameters (Event::JoystickButtonPressed, Event::JoystickButtonReleased)

View File

@ -363,10 +363,11 @@ int WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates& s
// Create and send our mouse wheel event // Create and send our mouse wheel event
Event event; Event event;
event.type = Event::MouseWheelMoved; event.type = Event::MouseWheelScrolled;
event.mouseWheel.delta = static_cast<double>(delta); event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
event.mouseWheel.x = AMotionEvent_getX(_event, 0); event.mouseWheelScroll.delta = static_cast<double>(delta);
event.mouseWheel.y = AMotionEvent_getY(_event, 0); event.mouseWheelScroll.x = AMotionEvent_getX(_event, 0);
event.mouseWheelScroll.y = AMotionEvent_getY(_event, 0);
forwardEvent(event); forwardEvent(event);

View File

@ -303,13 +303,6 @@ void WindowImplCocoa::mouseWheelScrolledAt(float deltaX, float deltaY, int x, in
{ {
Event event; Event event;
event.type = Event::MouseWheelMoved;
event.mouseWheel.delta = deltaY;
event.mouseWheel.x = x;
event.mouseWheel.y = y;
scaleOutXY(event.mouseWheel, m_delegate);
pushEvent(event);
event.type = Event::MouseWheelScrolled; event.type = Event::MouseWheelScrolled;
event.mouseWheelScroll.wheel = Mouse::VerticalWheel; event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
event.mouseWheelScroll.delta = deltaY; event.mouseWheelScroll.delta = deltaY;

View File

@ -2036,12 +2036,6 @@ bool WindowImplX11::processEvent(XEvent& windowEvent)
{ {
Event event; Event event;
event.type = Event::MouseWheelMoved;
event.mouseWheel.delta = (button == Button4) ? 1 : -1;
event.mouseWheel.x = windowEvent.xbutton.x;
event.mouseWheel.y = windowEvent.xbutton.y;
pushEvent(event);
event.type = Event::MouseWheelScrolled; event.type = Event::MouseWheelScrolled;
event.mouseWheelScroll.wheel = Mouse::VerticalWheel; event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
event.mouseWheelScroll.delta = (button == Button4) ? 1 : -1; event.mouseWheelScroll.delta = (button == Button4) ? 1 : -1;

View File

@ -769,12 +769,6 @@ void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
Event event; Event event;
event.type = Event::MouseWheelMoved;
event.mouseWheel.delta = delta / 120;
event.mouseWheel.x = position.x;
event.mouseWheel.y = position.y;
pushEvent(event);
event.type = Event::MouseWheelScrolled; event.type = Event::MouseWheelScrolled;
event.mouseWheelScroll.wheel = Mouse::VerticalWheel; event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
event.mouseWheelScroll.delta = static_cast<float>(delta) / 120.f; event.mouseWheelScroll.delta = static_cast<float>(delta) / 120.f;