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:
endolf 2007-06-28 20:37:24 +00:00
parent 10214031df
commit fd2a1b073d
5 changed files with 43 additions and 10 deletions

View file

@ -166,7 +166,7 @@ public final class DirectInputEnvironmentPlugin extends ControllerEnvironment im
private final Mouse createMouseFromDevice(IDirectInputDevice device) {
Component[] components = createComponents(device, true);
Mouse mouse = new DIMouse(device, components, new Controller[]{}, device.getRumblers());
if (mouse.getX() != null && mouse.getY() != null && mouse.getLeft() != null)
if (mouse.getX() != null && mouse.getY() != null && mouse.getPrimaryButton() != null)
return mouse;
else
return null;

View file

@ -128,17 +128,17 @@ final class RawMouse extends Mouse {
break;
case EVENT_BUTTON_0:
event_state = EVENT_BUTTON_1;
if (makeButtonEvent(current_event, event, getLeft(), RawDevice.RI_MOUSE_BUTTON_1_DOWN, RawDevice.RI_MOUSE_BUTTON_1_UP))
if (makeButtonEvent(current_event, event, getPrimaryButton(), RawDevice.RI_MOUSE_BUTTON_1_DOWN, RawDevice.RI_MOUSE_BUTTON_1_UP))
return true;
break;
case EVENT_BUTTON_1:
event_state = EVENT_BUTTON_2;
if (makeButtonEvent(current_event, event, getRight(), RawDevice.RI_MOUSE_BUTTON_2_DOWN, RawDevice.RI_MOUSE_BUTTON_2_UP))
if (makeButtonEvent(current_event, event, getSecondaryButton(), RawDevice.RI_MOUSE_BUTTON_2_DOWN, RawDevice.RI_MOUSE_BUTTON_2_UP))
return true;
break;
case EVENT_BUTTON_2:
event_state = EVENT_BUTTON_3;
if (makeButtonEvent(current_event, event, getMiddle(), RawDevice.RI_MOUSE_BUTTON_3_DOWN, RawDevice.RI_MOUSE_BUTTON_3_UP))
if (makeButtonEvent(current_event, event, getTertiaryButton(), RawDevice.RI_MOUSE_BUTTON_3_DOWN, RawDevice.RI_MOUSE_BUTTON_3_UP))
return true;
break;
case EVENT_BUTTON_3: