diff options
author | endolf <[email protected]> | 2007-06-28 20:37:24 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2007-06-28 20:37:24 +0000 |
commit | 56e0e6811b57f4628810b47122ce302e3da4094b (patch) | |
tree | 19a2b4b1146c92b43c9922a3ca3d49980a68df1a /coreAPI | |
parent | 8f42349adc3e5dd4998ad120c72386808c30be09 (diff) |
Make the API docs and the code match for the Mouse.get<button> methods. Add the methods that we actually wanted to be there.
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@189 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'coreAPI')
-rw-r--r-- | coreAPI/src/java/net/java/games/input/Mouse.java | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/coreAPI/src/java/net/java/games/input/Mouse.java b/coreAPI/src/java/net/java/games/input/Mouse.java index 8063eac..74301ff 100644 --- a/coreAPI/src/java/net/java/games/input/Mouse.java +++ b/coreAPI/src/java/net/java/games/input/Mouse.java @@ -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); } |