void mouseWheelMoved(const MouseEvent& event, Component* component) { const int wheelInc = event.getWheelIncrement(); // Do something with the wheelInc }
if (e.getWheelIncrement() < 0) { // Zoom out } else { // Zoom in }In this example, the getWheelIncrement method is used to determine the direction of the scrolling motion. If the returned value is less than 0, it means the user scrolled down and is zooming out. If the returned value is greater than or equal to 0, the user scrolled up and is zooming in. Package/Library: SDL Overall, the MouseEvent getWheelIncrement method is a useful tool for handling mouse wheel events in C++. Its implementation and usage may vary depending on the library or package used in the C++ project.