Class SoMouseWheelEvent

  • public class SoMouseWheelEvent
    extends SoEvent
    Mouse wheel events. SoMouseWheelEvent represents a change in mouse wheel rotation event in the Open Inventor event model.

    The wheel has discrete, evenly spaced notches. When you rotate the wheel, a wheel message is sent as each notch is encountered. Most modern mouse wheels generate an event with a value of 120 per each notch of the wheel. Pressing the shift key while moving the mouse wheel will generate events of double the wheel delta (i.e., 240 by default). If necessary, you can use environment variable OIV_WHEEL_DELTA to change this value (see SoPreferences).

    The getDelta() method returns the distance that the mouse wheel has been rotated. A positive value indicates the wheel was rotated forward (away from the user); a negative value indicates the wheel was rotated backwards (toward the user). The values are specified in multiples of the wheel delta.

    NOTE: Wheel delta values are NOT always +/- 120. In the case of wheel delta values in a browser, i.e. using RemoteViz, the base delta value seems to be scaled by the Windows Zoom level. E.g. with Windows 7 and Chrome, when using the default/typical "Medium" setting, the zoom level is 125% and the browser returns 125% * 120 = 150. It is safe to use the sign of the value (positive or negative).

    See Also:
    SoEvent, SoButtonEvent, SoKeyboardEvent, SoMotion3Event, SoMouseButtonEvent, SoSpaceballButtonEvent, SoHandleEventAction, SoEventCallback, SoSelection SoInteraction, SoWinDevice, SoMouseWheelEvent
    • Constructor Detail

      • SoMouseWheelEvent

        public SoMouseWheelEvent()
    • Method Detail

      • setDelta

        public void setDelta​(int delta)
        Sets the mouse wheel delta.
      • getDelta

        public int getDelta()
        Gets the mouse wheel delta.