mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2026-04-05 14:35:58 +00:00
Make the API docs and the code match for the Mouse.get<button> methods. Add the methods that we actually wanted to be there.
This commit is contained in:
parent
10214031df
commit
fd2a1b073d
5 changed files with 43 additions and 10 deletions
|
|
@ -82,22 +82,55 @@ public abstract class Mouse extends AbstractController {
|
|||
/**
|
||||
* Returns the left or primary mouse button, never null.
|
||||
*/
|
||||
public Component getLeft() {
|
||||
return getComponent(Component.Identifier.Button.LEFT);
|
||||
public Component getPrimaryButton() {
|
||||
Component primaryButton = getComponent(Component.Identifier.Button.LEFT);
|
||||
if(primaryButton==null) {
|
||||
primaryButton = getComponent(Component.Identifier.Button._1);
|
||||
}
|
||||
return primaryButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right or secondary mouse button, null if the mouse is
|
||||
* a single-button mouse.
|
||||
*/
|
||||
public Component getRight() {
|
||||
return getComponent(Component.Identifier.Button.RIGHT);
|
||||
public Component getSecondaryButton() {
|
||||
Component secondaryButton = getComponent(Component.Identifier.Button.RIGHT);
|
||||
if(secondaryButton==null) {
|
||||
secondaryButton = getComponent(Component.Identifier.Button._2);
|
||||
}
|
||||
return secondaryButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the middle or tertiary mouse button, null if the mouse has
|
||||
* fewer than three buttons.
|
||||
*/
|
||||
public Component getTertiaryButton() {
|
||||
Component tertiaryButton = getComponent(Component.Identifier.Button.MIDDLE);
|
||||
if(tertiaryButton==null) {
|
||||
tertiaryButton = getComponent(Component.Identifier.Button._3);
|
||||
}
|
||||
return tertiaryButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left mouse button.
|
||||
*/
|
||||
public Component getLeft() {
|
||||
return getComponent(Component.Identifier.Button.LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right, null if the mouse is a single-button mouse.
|
||||
*/
|
||||
public Component getRight() {
|
||||
return getComponent(Component.Identifier.Button.RIGHT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the middle, null if the mouse has fewer than three buttons.
|
||||
*/
|
||||
public Component getMiddle() {
|
||||
return getComponent(Component.Identifier.Button.MIDDLE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue