Structuur consequenter gemaakt met initialise en exit methoden. De start methode wordt gereserveerd voor wanneer er een Thread moet worden gestart. Exceptions georganiseerd, hierbij opletten op het doorgeven van exceptions vanuit Threads! Poging tot het dynamisch toevoegen van devices is niet helemaal gelukt.
This commit is contained in:
@@ -2,12 +2,11 @@ package pm.device.javainput.rumblepad;
|
||||
|
||||
import pm.Action;
|
||||
import pm.Button;
|
||||
import pm.Macro;
|
||||
import pm.Target;
|
||||
import pm.device.javainput.DirectionalSwitch;
|
||||
import pm.device.javainput.DirectionButton;
|
||||
import pm.device.javainput.JavaInputDevice;
|
||||
import pm.exception.DeviceException;
|
||||
import pm.exception.MacroException;
|
||||
import pm.exception.device.DeviceInitialiseException;
|
||||
import pm.exception.event.UnknownButtonException;
|
||||
import pm.exception.event.UnknownDirectionException;
|
||||
import pm.macro.event.Press;
|
||||
@@ -15,15 +14,10 @@ import de.hardcode.jxinput.event.JXInputButtonEvent;
|
||||
import de.hardcode.jxinput.event.JXInputDirectionalEvent;
|
||||
|
||||
public class RumblepadDevice extends JavaInputDevice {
|
||||
|
||||
protected static final String NAME = "Logitech RumblePad 2 USB";
|
||||
|
||||
public RumblepadDevice() throws DeviceException {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
super.start();
|
||||
public void initialise() throws DeviceInitialiseException {
|
||||
super.initialise(NAME);
|
||||
try {
|
||||
add(
|
||||
new Press(RumblepadButton.ONE),
|
||||
@@ -62,6 +56,6 @@ public class RumblepadDevice extends JavaInputDevice {
|
||||
}
|
||||
|
||||
protected Button getButton(JXInputDirectionalEvent event) throws UnknownDirectionException {
|
||||
return DirectionalSwitch.create(event);
|
||||
return DirectionButton.create(event);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user