diff --git a/src/org/wiigee/device/Device.java b/src/org/wiigee/device/Device.java index 6413610..796b952 100644 --- a/src/org/wiigee/device/Device.java +++ b/src/org/wiigee/device/Device.java @@ -205,8 +205,8 @@ public class Device { /** Fires a button released event. */ - public void fireButtonReleasedEvent() { - ButtonReleasedEvent w = new ButtonReleasedEvent(this); + public void fireButtonReleasedEvent(int button) { + ButtonReleasedEvent w = new ButtonReleasedEvent(this, button); for (int i = 0; i < this.buttonlistener.size(); i++) { this.buttonlistener.get(i).buttonReleaseReceived(w); } diff --git a/src/org/wiigee/event/ButtonPressedEvent.java b/src/org/wiigee/event/ButtonPressedEvent.java index d08619b..36d54a4 100755 --- a/src/org/wiigee/event/ButtonPressedEvent.java +++ b/src/org/wiigee/event/ButtonPressedEvent.java @@ -33,25 +33,6 @@ import org.wiigee.device.*; * representation of which button has been pressed. Please note that * there exist enumeration constants in the class, so you don't * have to use this integer values directly. - * - * Button 1 matches button "2" on wiimote - * Button 2 matches button "1" on wiimote - * Button 3 matches button "B" on wiimote - * Button 4 matches button "A" on wiimote - * Button 5 matches button "MINUS" on wiimote - * Button 6 unknown - * Button 7 unknown - * Button 8 matches button "HOME" on wiimote - * Button 9 matches "CROSS LEFT" on wiimote - * Button 10 matches "CROSS RIGHT" on wiimote - * Button 11 matches "CROSS DOWN" on wiimote - * Button 12 matches "CROSS UP" on wiimote - * Button 13 matches button "PLUS" on wiimote - * Button 14 unknown - * Button 15 unknown - * Button 16 unknown - * - * There can be other interpretations of buttons for other devices. * * @author Benjamin 'BePo' Poppinga */ diff --git a/src/org/wiigee/event/ButtonReleasedEvent.java b/src/org/wiigee/event/ButtonReleasedEvent.java index b566c9f..45de43b 100755 --- a/src/org/wiigee/event/ButtonReleasedEvent.java +++ b/src/org/wiigee/event/ButtonReleasedEvent.java @@ -35,9 +35,15 @@ import org.wiigee.device.*; */ public class ButtonReleasedEvent extends ActionStopEvent { - public ButtonReleasedEvent(Device source) { + int button; + + public ButtonReleasedEvent(Device source, int button) { super(source); + this.button = button; } - + + public int getButton() { + return this.button; + } }