This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package pm.device.javainput.extreme3d;
|
||||
|
||||
import de.hardcode.jxinput.event.JXInputAxisEvent;
|
||||
import de.hardcode.jxinput.event.JXInputButtonEvent;
|
||||
import de.hardcode.jxinput.event.JXInputDirectionalEvent;
|
||||
|
||||
import pm.Macro;
|
||||
import pm.action.Actions;
|
||||
import pm.action.Targets;
|
||||
import pm.device.javainput.JavaInputDevice;
|
||||
import pm.exception.DeviceException;
|
||||
import pm.exception.EventException;
|
||||
import pm.exception.event.UnknownDirectionException;
|
||||
import pm.exception.MacroException;
|
||||
import pm.macro.event.Hold;
|
||||
import pm.macro.event.Press;
|
||||
import pm.macro.event.Release;
|
||||
|
||||
public class Extreme3DDevice extends JavaInputDevice {
|
||||
|
||||
@@ -20,42 +20,17 @@ public class Extreme3DDevice extends JavaInputDevice {
|
||||
|
||||
public void start() {
|
||||
super.start();
|
||||
macroListener.addMacro(
|
||||
new Macro(
|
||||
new Hold(Button.A),
|
||||
new Press(Button.B),
|
||||
new Press(Button.TWO),
|
||||
new Release(Button.A)),
|
||||
Action.EXIT, Target.APPLICATION));
|
||||
}
|
||||
|
||||
public void processEvent(JXInputAxisEvent event) {
|
||||
//addAction(Action.START, Target.APPLICATION);
|
||||
//System.out.println(event);
|
||||
}
|
||||
|
||||
public void processEvent(JXInputButtonEvent event) throws EventException {
|
||||
//addAction(Action.TEST, Target.APPLICATION);
|
||||
if (event.getButton().getState()) {
|
||||
// press
|
||||
} else {
|
||||
// release
|
||||
try {
|
||||
macroListener.add(
|
||||
new Macro(
|
||||
new Hold(Extreme3DButton.ONE),
|
||||
new Press(Extreme3DButton.TWO),
|
||||
new Press(Extreme3DButton.ELEVEN),
|
||||
new Release(Extreme3DButton.ONE)),
|
||||
Actions.EXIT,
|
||||
Targets.MAIN);
|
||||
} catch (MacroException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(Extreme3DButton.create(event));
|
||||
//System.out.println(button.getType() + " " + button.getName() +" " + );
|
||||
}
|
||||
|
||||
public void processEvent(JXInputDirectionalEvent event) throws UnknownDirectionException {
|
||||
//addAction(Action.EXIT, Target.APPLICATION);
|
||||
//Directional directional = event.getDirectional();
|
||||
if (event.getDirectional().isCentered()) {
|
||||
// release
|
||||
} else {
|
||||
// press
|
||||
}
|
||||
System.out.println(Extreme3DDirection.create(event));
|
||||
//System.out.println(Extreme3DButton.create(event));
|
||||
//System.out.println(directional.isCentered() + " " + directional.getValue() + " [" + directional.getName() + "] " + directional.getResolution() + " " + directional.getDirection());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user