diff options
author | endolf <[email protected]> | 2003-07-31 19:38:44 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2003-07-31 19:38:44 +0000 |
commit | beb5c4079c2490f9a609f81439c6f4e8d13d1824 (patch) | |
tree | 151f35f5ef27e85cd4200503ef8edc5d7a372624 /coreAPI/src/java | |
parent | 413b67d38987408f3a2016cf496166493c7e0223 (diff) |
Added 4 new mouse buttons
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@25 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'coreAPI/src/java')
-rw-r--r-- | coreAPI/src/java/net/java/games/input/Mouse.java | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/coreAPI/src/java/net/java/games/input/Mouse.java b/coreAPI/src/java/net/java/games/input/Mouse.java index 6029834..7f8449f 100644 --- a/coreAPI/src/java/net/java/games/input/Mouse.java +++ b/coreAPI/src/java/net/java/games/input/Mouse.java @@ -202,6 +202,26 @@ public abstract class Mouse extends AbstractController { protected Button middle; /** + * Side button; should be initialized by subclasses + */ + protected Button side; + + /** + * Extra button; should be initialized by subclasses + */ + protected Button extra; + + /** + * Forward button; should be initialized by subclasses + */ + protected Button forward; + + /** + * Back button; should be initialized by subclasses + */ + protected Button back; + + /** * Protected constructor */ protected Buttons(String name) { @@ -239,6 +259,38 @@ public abstract class Mouse extends AbstractController { } /** + * Returns the side or 4th mouse button, null if the mouse has + * fewer than 4 buttons. + */ + public Button getSide() { + return side; + } + + /** + * Returns the extra or 5th mouse button, null if the mouse has + * fewer than 5 buttons. + */ + public Button getExtra() { + return extra; + } + + /** + * Returns the forward mouse button, null if the mouse hasn't + * got one. + */ + public Button getForward() { + return forward; + } + + /** + * Returns the back mouse button, null if the mouse hasn't + * got one. + */ + public Button getBack() { + return back; + } + + /** * Returns the axes on this controller, in order of assignment priority. * Overridden to return the the primary or leftmost mouse button, * followed by the secondary or rightmost mouse button (if present), @@ -252,8 +304,16 @@ public abstract class Mouse extends AbstractController { axes = new Axis[] { left }; } else if (middle == null) { axes = new Axis[] { left, right }; - } else { + } else if (side == null) { axes = new Axis[] { left, right, middle }; + } else if (extra == null) { + axes = new Axis[] { left, right, middle, side }; + } else if (forward == null) { + axes = new Axis[] { left, right, middle, side, extra }; + } else if (back == null) { + axes = new Axis[] { left, right, middle, side, extra, forward }; + } else { + axes = new Axis[] { left, right, middle, side, extra, forward, back }; } } return axes; @@ -311,5 +371,26 @@ public abstract class Mouse extends AbstractController { * mouse has fewer than three buttons. */ public static final ButtonID MIDDLE = new ButtonID("middle"); + + /** + * Returns the side mouse button. + */ + public static final ButtonID SIDE = new ButtonID("side"); + + /** + * Returns the extra mouse button. + */ + public static final ButtonID EXTRA = new ButtonID("extra"); + + /** + * Returns the forward mouse button. + */ + public static final ButtonID FORWARD = new ButtonID("forward"); + + /** + * Returns the back mouse button. + */ + public static final ButtonID BACK = new ButtonID("back"); + } // class Mouse.ButtonID } // class Mouse |