Package lc.kra.system.mouse.event
Class GlobalMouseEvent
- java.lang.Object
-
- java.util.EventObject
-
- lc.kra.system.mouse.event.GlobalMouseEvent
-
- All Implemented Interfaces:
Serializable
public class GlobalMouseEvent extends EventObject
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intBUTTON_LEFTMouse button identifiersstatic intBUTTON_MIDDLEMouse button identifiersstatic intBUTTON_NOMouse button identifiersstatic intBUTTON_RIGHTMouse button identifiersstatic intBUTTON_X1Mouse button identifiersstatic intBUTTON_X2Mouse button identifiersstatic intTS_DOWNKey transition states (up / down)static intTS_MOVEKey transition states (up / down)static intTS_UPKey transition states (up / down)static intTS_WHEELKey transition states (up / down)static intWHEEL_DELTAWheel delta parameter-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description GlobalMouseEvent(Object source, int transitionState, int button, int buttons, int x, int y, int delta, long deviceHandle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetButton()Returns the mouse current button pressed on TS_UP or TS_DOWN transition states.intgetButtons()Returns the bitwise or of all buttons currently pressed on the mouse.intgetDelta()By default this method returns a multiple ofWHEEL_DELTAindicating the scroll speed of the users mouse wheel.longgetDeviceHandle()intgetTransitionState()Returns the transition state (mouse up/down, move or mouse wheel) for this mouse event.intgetX()Returns the absolute horizontal screen coordinate where this mouse event occurred.intgetY()Returns the absolute vertical screen coordinate where this mouse event occurred.StringtoString()Returns a String representation of this GlobalMouseEvent.-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Field Detail
-
TS_UP
public static final int TS_UP
Key transition states (up / down)- See Also:
- Constant Field Values
-
TS_DOWN
public static final int TS_DOWN
Key transition states (up / down)- See Also:
- Constant Field Values
-
TS_MOVE
public static final int TS_MOVE
Key transition states (up / down)- See Also:
- Constant Field Values
-
TS_WHEEL
public static final int TS_WHEEL
Key transition states (up / down)- See Also:
- Constant Field Values
-
BUTTON_NO
public static final int BUTTON_NO
Mouse button identifiers- See Also:
- Constant Field Values
-
BUTTON_LEFT
public static final int BUTTON_LEFT
Mouse button identifiers- See Also:
- Constant Field Values
-
BUTTON_RIGHT
public static final int BUTTON_RIGHT
Mouse button identifiers- See Also:
- Constant Field Values
-
BUTTON_MIDDLE
public static final int BUTTON_MIDDLE
Mouse button identifiers- See Also:
- Constant Field Values
-
BUTTON_X1
public static final int BUTTON_X1
Mouse button identifiers- See Also:
- Constant Field Values
-
BUTTON_X2
public static final int BUTTON_X2
Mouse button identifiers- See Also:
- Constant Field Values
-
WHEEL_DELTA
public static final int WHEEL_DELTA
Wheel delta parameter- See Also:
- Constant Field Values
-
-
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.
-
getButton
public int getButton()
Returns the mouse current button pressed on TS_UP or TS_DOWN transition states.- Returns:
- One of BUTTON_LEFT, BUTTON_RIGHT, BUTTON_MIDDLE or BUTTON_NO if not in transition state
TS_UPorTS_DOWN. - See Also:
getTransitionState(),BUTTON_NO,BUTTON_LEFT,BUTTON_RIGHT,BUTTON_MIDDLE
-
getButtons
public int getButtons()
Returns the bitwise or of all buttons currently pressed on the mouse. If just one button is pressed the same value as forgetButton()is returned.- Returns:
- The bitwise addition of
BUTTON_LEFT,BUTTON_RIGHTandBUTTON_MIDDLE. - See Also:
getButton()
-
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 ofWHEEL_DELTAindicating 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:
toStringin classEventObject- Returns:
- A a String representation of this GlobalMouseEvent.
-
-