From 8f42349adc3e5dd4998ad120c72386808c30be09 Mon Sep 17 00:00:00 2001 From: endolf Date: Wed, 20 Jun 2007 21:04:46 +0000 Subject: Raw input has mouse buttons 4 and 5 as button 3 and 4 not side and extra. git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@188 e343933a-64c8-49c5-92b1-88f2ce3e89e8 --- coreAPI/src/java/net/java/games/input/Mouse.java | 17 +++++++++++++++++ .../windows/src/java/net/java/games/input/RawMouse.java | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/coreAPI/src/java/net/java/games/input/Mouse.java b/coreAPI/src/java/net/java/games/input/Mouse.java index 83676a4..8063eac 100644 --- a/coreAPI/src/java/net/java/games/input/Mouse.java +++ b/coreAPI/src/java/net/java/games/input/Mouse.java @@ -133,4 +133,21 @@ public abstract class Mouse extends AbstractController { public Component getBack() { return getComponent(Component.Identifier.Button.BACK); } + + /** + * Returns forth mouse button, null if the mouse hasn't + * got one. + */ + public Component getButton3() { + return getComponent(Component.Identifier.Button._3); + } + + /** + * Returns fifth mouse button, null if the mouse hasn't + * got one. + */ + public Component getButton4() { + return getComponent(Component.Identifier.Button._4); + } + } // class Mouse diff --git a/plugins/windows/src/java/net/java/games/input/RawMouse.java b/plugins/windows/src/java/net/java/games/input/RawMouse.java index 64b1969..e6fc324 100644 --- a/plugins/windows/src/java/net/java/games/input/RawMouse.java +++ b/plugins/windows/src/java/net/java/games/input/RawMouse.java @@ -143,12 +143,12 @@ final class RawMouse extends Mouse { break; case EVENT_BUTTON_3: event_state = EVENT_BUTTON_4; - if (makeButtonEvent(current_event, event, getSide(), RawDevice.RI_MOUSE_BUTTON_4_DOWN, RawDevice.RI_MOUSE_BUTTON_4_UP)) + if (makeButtonEvent(current_event, event, getButton3(), RawDevice.RI_MOUSE_BUTTON_4_DOWN, RawDevice.RI_MOUSE_BUTTON_4_UP)) return true; break; case EVENT_BUTTON_4: event_state = EVENT_DONE; - if (makeButtonEvent(current_event, event, getExtra(), RawDevice.RI_MOUSE_BUTTON_5_DOWN, RawDevice.RI_MOUSE_BUTTON_5_UP)) + if (makeButtonEvent(current_event, event, getButton4(), RawDevice.RI_MOUSE_BUTTON_5_DOWN, RawDevice.RI_MOUSE_BUTTON_5_UP)) return true; break; default: -- cgit v1.2.3