java.lang.Object
com.googlecode.lanterna.input.KeyStroke
com.googlecode.lanterna.input.MouseAction
MouseAction, a KeyStroke in disguise, this class contains the information of a single mouse action event.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.googlecode.lanterna.input.KeyStroke
KeyStroke.RealF3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MouseActionType
private final int
private final TerminalPosition
-
Constructor Summary
ConstructorsConstructorDescriptionMouseAction
(MouseActionType actionType, int button, TerminalPosition position) Constructs a MouseAction based on an action type, a button and a location on the screen -
Method Summary
Modifier and TypeMethodDescriptionReturns the mouse action type so the caller can determine which kind of action was performed.int
Which button was involved in this event.The location of the mouse cursor when this event was generated.boolean
boolean
boolean
boolean
toString()
Methods inherited from class com.googlecode.lanterna.input.KeyStroke
equals, fromString, getCharacter, getEventTime, getKeyType, hashCode, isAltDown, isCtrlDown, isShiftDown
-
Field Details
-
actionType
-
button
private final int button -
position
-
-
Constructor Details
-
MouseAction
Constructs a MouseAction based on an action type, a button and a location on the screen- Parameters:
actionType
- The kind of mouse eventbutton
- Which button is involved (no button = 0, left button = 1, middle (wheel) button = 2, right button = 3, scroll wheel up = 4, scroll wheel down = 5)position
- Where in the terminal is the mouse cursor located
-
-
Method Details
-
getActionType
Returns the mouse action type so the caller can determine which kind of action was performed.- Returns:
- The action type of the mouse event
-
getButton
public int getButton()Which button was involved in this event. Please note that for CLICK_RELEASE events, there is no button information available (getButton() will return 0). The standard xterm mapping is:- No button = 0
- Left button = 1
- Middle (wheel) button = 2
- Right button = 3
- Wheel up = 4
- Wheel down = 5
- Returns:
- The button which is clicked down when this event was generated
-
getPosition
The location of the mouse cursor when this event was generated.- Returns:
- Location of the mouse cursor
-
isMouseDown
public boolean isMouseDown() -
isMouseDrag
public boolean isMouseDrag() -
isMouseMove
public boolean isMouseMove() -
isMouseUp
public boolean isMouseUp() -
toString
-