Package com.luciad.input.mouse
Class MouseButton
java.lang.Object
com.luciad.input.mouse.MouseButton
Represents a mouse button in the controller API.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MouseButton
Returns the left mouse button.static final MouseButton
Returns the middle mouse button.static final MouseButton
Returns the right mouse button.static final MouseButton
Returns an unknown mouse button. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
getIndex()
The mouse button index.int
hashCode()
boolean
isLeft()
Returns whether the button is the left mouse button.boolean
isMiddle()
Returns whether the button is the middle mouse button.boolean
isRight()
Returns whether the button is the right mouse button.boolean
Returns whether the button is unknown.
-
Field Details
-
Unknown
Returns an unknown mouse button. -
Left
Returns the left mouse button. -
Middle
Returns the middle mouse button. -
Right
Returns the right mouse button.
-
-
Constructor Details
-
MouseButton
public MouseButton(long index) Creates a newMouseButton
with the given index.The mouse button index maps to mouse buttons as follows:
- 0 => unknown button
- 1 => left mouse button (primary button)
- 2 => middle mouse button
- 3 => right mouse button
Unmapped values can be used to express a custom mouse button.
- Parameters:
index
- the mouse button index.
-
-
Method Details
-
getIndex
public long getIndex()The mouse button index. -
isUnknown
public boolean isUnknown()Returns whether the button is unknown.- Returns:
- whether the button is unknown.
-
isLeft
public boolean isLeft()Returns whether the button is the left mouse button.- Returns:
- whether the button is the left mouse button.
-
isMiddle
public boolean isMiddle()Returns whether the button is the middle mouse button.- Returns:
- whether the button is the middle mouse button.
-
isRight
public boolean isRight()Returns whether the button is the right mouse button.- Returns:
- whether the button is the right mouse button.
-
equals
-
hashCode
public int hashCode()
-