Work in progress: fixing gamepad to work on all OSs and be customizable

This commit is contained in:
Diego Waxemberg
2013-12-19 17:31:14 -05:00
parent 06a217da94
commit c32d7a1c22
5 changed files with 180 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ public abstract class Gamepad {
protected short leftStickX = 0x0000;
protected short leftStickY = 0x0000;
protected GamepadSettings configuration;
public enum ControllerType { XBOX, PS3 };
@@ -37,12 +39,18 @@ public abstract class Gamepad {
this.conn = conn;
this.pad = pad;
configuration = new GamepadSettings();
for (Component comp : pad.getComponents()) {
initValue(comp);
}
}
public GamepadSettings getConfiguration() {
return configuration;
}
private void initValue(Component comp) {
handleComponent(comp, comp.getPollData());
}
@@ -56,6 +64,10 @@ public abstract class Gamepad {
leftStickX, leftStickY, rightStickX, rightStickY);
}
public EventQueue getEvents() {
return pad.getEventQueue();
}
public void handleEvents() {
EventQueue queue = pad.getEventQueue();
Event event = new Event();