mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Bit of a tidy up
This commit is contained in:
parent
aa96d5c1be
commit
940c48b558
|
|
@ -1,7 +1,30 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import net.java.games.input.Component.Identifier;
|
|
||||||
|
|
||||||
public class WinTabButtonComponent extends WinTabComponent {
|
public class WinTabButtonComponent extends WinTabComponent {
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,28 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -6,8 +31,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.java.games.input.Component.Identifier;
|
|
||||||
|
|
||||||
public class WinTabComponent extends AbstractComponent {
|
public class WinTabComponent extends AbstractComponent {
|
||||||
|
|
||||||
public final static int XAxis = 1;
|
public final static int XAxis = 1;
|
||||||
|
|
@ -18,28 +41,22 @@ public class WinTabComponent extends AbstractComponent {
|
||||||
public final static int OrientationAxis = 6;
|
public final static int OrientationAxis = 6;
|
||||||
public final static int RotationAxis = 7;
|
public final static int RotationAxis = 7;
|
||||||
|
|
||||||
private int parentDevice;
|
|
||||||
private int min;
|
private int min;
|
||||||
private int max;
|
private int max;
|
||||||
private WinTabContext context;
|
|
||||||
protected float lastKnownValue;
|
protected float lastKnownValue;
|
||||||
private boolean analog;
|
private boolean analog;
|
||||||
|
|
||||||
protected WinTabComponent(WinTabContext context, int parentDevice, String name, Identifier id, int min, int max) {
|
protected WinTabComponent(WinTabContext context, int parentDevice, String name, Identifier id, int min, int max) {
|
||||||
super(name, id);
|
super(name, id);
|
||||||
this.parentDevice = parentDevice;
|
|
||||||
this.min = min;
|
this.min = min;
|
||||||
this.max = max;
|
this.max = max;
|
||||||
this.context = context;
|
|
||||||
analog = true;
|
analog = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected WinTabComponent(WinTabContext context, int parentDevice, String name, Identifier id) {
|
protected WinTabComponent(WinTabContext context, int parentDevice, String name, Identifier id) {
|
||||||
super(name, id);
|
super(name, id);
|
||||||
this.parentDevice = parentDevice;
|
|
||||||
this.min = 0;
|
this.min = 0;
|
||||||
this.max = 1;
|
this.max = 1;
|
||||||
this.context = context;
|
|
||||||
analog = false;
|
analog = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,28 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,30 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import net.java.games.input.Component.Identifier;
|
|
||||||
|
|
||||||
public class WinTabCursorComponent extends WinTabComponent {
|
public class WinTabCursorComponent extends WinTabComponent {
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,40 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.java.games.input.Component.Identifier;
|
|
||||||
|
|
||||||
public class WinTabDevice extends AbstractController {
|
public class WinTabDevice extends AbstractController {
|
||||||
private int deviceIndex;
|
|
||||||
private WinTabContext context;
|
private WinTabContext context;
|
||||||
private List eventList = new ArrayList();
|
private List eventList = new ArrayList();
|
||||||
|
|
||||||
private WinTabDevice(WinTabContext context, int index, String name, Component[] components) {
|
private WinTabDevice(WinTabContext context, int index, String name, Component[] components) {
|
||||||
super(name, components, new Controller[0], new Rumbler[0]);
|
super(name, components, new Controller[0], new Rumbler[0]);
|
||||||
this.deviceIndex = index;
|
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,31 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -60,7 +84,6 @@ public class WinTabEnvironmentPlugin extends ControllerEnvironment implements Pl
|
||||||
|
|
||||||
private final Controller[] controllers;
|
private final Controller[] controllers;
|
||||||
private final List active_devices = new ArrayList();
|
private final List active_devices = new ArrayList();
|
||||||
private final DummyWindow window;
|
|
||||||
private final WinTabContext winTabContext;
|
private final WinTabContext winTabContext;
|
||||||
|
|
||||||
/** Creates new DirectInputEnvironment */
|
/** Creates new DirectInputEnvironment */
|
||||||
|
|
@ -83,7 +106,6 @@ public class WinTabEnvironmentPlugin extends ControllerEnvironment implements Pl
|
||||||
logln("Failed to enumerate devices: " + e.getMessage());
|
logln("Failed to enumerate devices: " + e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
this.window = window;
|
|
||||||
this.controllers = controllers;
|
this.controllers = controllers;
|
||||||
this.winTabContext = winTabContext;
|
this.winTabContext = winTabContext;
|
||||||
AccessController.doPrivileged(
|
AccessController.doPrivileged(
|
||||||
|
|
@ -96,7 +118,6 @@ public class WinTabEnvironmentPlugin extends ControllerEnvironment implements Pl
|
||||||
} else {
|
} else {
|
||||||
winTabContext = null;
|
winTabContext = null;
|
||||||
controllers = new Controller[]{};
|
controllers = new Controller[]{};
|
||||||
window = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,28 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2006 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
public class WinTabPacket {
|
public class WinTabPacket {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue