Class GlobalMouseEvent

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BUTTON_LEFT
      Mouse button identifiers
      static int BUTTON_MIDDLE
      Mouse button identifiers
      static int BUTTON_NO
      Mouse button identifiers
      static int BUTTON_RIGHT
      Mouse button identifiers
      static int BUTTON_X1
      Mouse button identifiers
      static int BUTTON_X2
      Mouse button identifiers
      static int TS_DOWN
      Key transition states (up / down)
      static int TS_MOVE
      Key transition states (up / down)
      static int TS_UP
      Key transition states (up / down)
      static int TS_WHEEL
      Key transition states (up / down)
      static int WHEEL_DELTA
      Wheel delta parameter
    • Constructor Summary

      Constructors 
      Constructor Description
      GlobalMouseEvent​(Object source, int transitionState, int button, int buttons, int x, int y, int delta, long deviceHandle)  
    • Constructor Detail

      • GlobalMouseEvent

        public GlobalMouseEvent​(Object source,
                                int transitionState,
                                int button,
                                int buttons,
                                int x,
                                int y,
                                int delta,
                                long deviceHandle)
    • Method Detail

      • getTransitionState

        public int getTransitionState()
        Returns the transition state (mouse up/down, move or mouse wheel) for this mouse event.
        Returns:
        either one of TS_UP, TS_DOWN, TS_MOVE, TS_WHEEL.
        See Also:
        TS_UP, TS_DOWN, TS_MOVE, TS_WHEEL
      • getX

        public int getX()
        Returns the absolute horizontal screen coordinate where this mouse event occurred.
        Returns:
        An absolute X position of the cursor on the screen.
      • getY

        public int getY()
        Returns the absolute vertical screen coordinate where this mouse event occurred.
        Returns:
        An absolute Y position of the cursor on the screen.
      • getDelta

        public int getDelta()
        By default this method returns a multiple of WHEEL_DELTA indicating the scroll speed of the users mouse wheel. As e.g. for freely-rotating wheels with no notches a finder finer-resolution is set, in a higher interval.
        Returns:
        The relative change (delta) of the mouse wheel movement.
      • getDeviceHandle

        public long getDeviceHandle()
        Returns:
        the handle of the mouse the input was received from.
      • toString

        public String toString()
        Returns a String representation of this GlobalMouseEvent.
        Overrides:
        toString in class EventObject
        Returns:
        A a String representation of this GlobalMouseEvent.