Services en JXInput als java input device geimplementeerd.
This commit is contained in:
27
java/src/pm/device/JavaInputDevice.java
Normal file
27
java/src/pm/device/JavaInputDevice.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package pm.device;
|
||||
|
||||
import java.util.Queue;
|
||||
|
||||
import de.hardcode.jxinput.JXInputDevice;
|
||||
|
||||
import pm.action.Action;
|
||||
import pm.exception.ServiceJavaInputException;
|
||||
import pm.service.javainput.JavaInputService;
|
||||
|
||||
public abstract class JavaInputDevice extends Device {
|
||||
|
||||
public static JavaInputService jxinputService;
|
||||
|
||||
protected JavaInputDevice(Queue<Action> actionQueue, String name) throws ServiceJavaInputException {
|
||||
super(actionQueue);
|
||||
if (jxinputService == null) {
|
||||
throw new ServiceJavaInputException();
|
||||
}
|
||||
JXInputDevice x = jxinputService.getDevice(name);
|
||||
System.out.printf("Initialized: %s\n", x.getName());
|
||||
}
|
||||
|
||||
public void initialise() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@ import pm.action.Action;
|
||||
import pm.device.Device;
|
||||
import pm.event.Target;
|
||||
|
||||
public class Example extends Device {
|
||||
public Example(Queue<Action> actionQueue) {
|
||||
public class ExampleDevice extends Device {
|
||||
public ExampleDevice(Queue<Action> actionQueue) {
|
||||
super(actionQueue);
|
||||
}
|
||||
|
||||
@@ -16,4 +16,13 @@ public class Example extends Device {
|
||||
addAction(Action.TEST, Target.APPLICATION);
|
||||
addAction(Action.EXIT, Target.MAIN);
|
||||
}
|
||||
|
||||
public void processEvent() {
|
||||
/*ExampleEvent de;
|
||||
if (specifiekEvent == start) {
|
||||
addAction()
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
17
java/src/pm/device/rumblepad/RumblepadDevice.java
Normal file
17
java/src/pm/device/rumblepad/RumblepadDevice.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package pm.device.rumblepad;
|
||||
|
||||
import java.util.Queue;
|
||||
|
||||
import pm.action.Action;
|
||||
import pm.device.JavaInputDevice;
|
||||
import pm.exception.ServiceJavaInputException;
|
||||
|
||||
public class RumblepadDevice extends JavaInputDevice {
|
||||
|
||||
protected static final String NAME = "Logitech RumblePad 2 USB";
|
||||
|
||||
public RumblepadDevice(Queue<Action> actionQueue) throws ServiceJavaInputException {
|
||||
super(actionQueue, NAME);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user