inputs now work outside of window focus.dev
parent
93e062ad42
commit
e203715025
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1,2 @@ |
||||
java -jar ./sigIRCv2.jar -Djava.library.path=lib/ |
||||
cd "C:\Users\Joshua Sigona\git\sigIRCv2\" |
||||
java -jar sigIRCv2.jar -Djinput.useDefaultPlugin=false -Djinput.plugins=net.java.games.input.DirectInputEnvironmentPlugin |
||||
|
Binary file not shown.
@ -0,0 +1,25 @@ |
||||
package sig.modules.Controller; |
||||
|
||||
public class Component { |
||||
|
||||
public boolean isAnalog() { |
||||
// TODO Auto-generated method stub
|
||||
return false; |
||||
} |
||||
|
||||
public float getPollData() { |
||||
// TODO Auto-generated method stub
|
||||
return 0; |
||||
} |
||||
|
||||
public Identifier getIdentifier() { |
||||
// TODO Auto-generated method stub
|
||||
return null; |
||||
} |
||||
|
||||
public String getName() { |
||||
// TODO Auto-generated method stub
|
||||
return null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,80 @@ |
||||
package sig.modules.Controller; |
||||
|
||||
import java.nio.ByteBuffer; |
||||
import java.nio.FloatBuffer; |
||||
import java.util.Arrays; |
||||
|
||||
import org.lwjgl.glfw.GLFW; |
||||
|
||||
|
||||
public class Controller { |
||||
int identifier; |
||||
float[] axes; |
||||
byte[] buttons; |
||||
|
||||
public Controller(int identifier) { |
||||
this.identifier=identifier; |
||||
FloatBuffer axisBuffer = GLFW.glfwGetJoystickAxes(identifier); |
||||
axes = new float[axisBuffer.limit()]; |
||||
axisBuffer.get(axes); |
||||
ByteBuffer buttonBuffer = GLFW.glfwGetJoystickButtons(identifier); |
||||
buttons = new byte[buttonBuffer.limit()]; |
||||
buttonBuffer.get(buttons); |
||||
} |
||||
|
||||
public String outputAxes() { |
||||
return Arrays.toString(axes); |
||||
} |
||||
|
||||
public String outputButtons() { |
||||
return Arrays.toString(buttons); |
||||
} |
||||
|
||||
public float[] getAxes() { |
||||
return axes; |
||||
} |
||||
|
||||
public byte[] getButtons() { |
||||
return buttons; |
||||
} |
||||
|
||||
public float getAxisValue(int axisNumber) { |
||||
return axes[axisNumber]; |
||||
} |
||||
|
||||
public byte getButtonValue(int buttonNumber) { |
||||
return buttons[buttonNumber]; |
||||
} |
||||
|
||||
@Deprecated |
||||
public Type getType() { |
||||
return null; |
||||
} |
||||
|
||||
@Deprecated |
||||
public String getName() { |
||||
return null; |
||||
} |
||||
|
||||
public void poll() { |
||||
//System.out.println(Glfw.glfwGetJoystickParam(identifier, 1));
|
||||
FloatBuffer axisBuffer = GLFW.glfwGetJoystickAxes(identifier); |
||||
axes = new float[axisBuffer.limit()]; |
||||
axisBuffer.get(axes); |
||||
ByteBuffer buttonBuffer = GLFW.glfwGetJoystickButtons(identifier); |
||||
buttons = new byte[buttonBuffer.limit()]; |
||||
buttonBuffer.get(buttons); |
||||
//System.out.println(outputAxes()+","+outputButtons());
|
||||
} |
||||
|
||||
@Deprecated |
||||
public Component[] getComponents() { |
||||
return new Component[]{}; |
||||
} |
||||
|
||||
@Deprecated |
||||
public Component getComponent(Identifier identifier2) { |
||||
return null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,11 @@ |
||||
package sig.modules.Controller; |
||||
|
||||
import java.awt.geom.RectangularShape; |
||||
|
||||
public class Identifier { |
||||
|
||||
public String getName() { |
||||
return null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
package sig.modules.Controller; |
||||
|
||||
public enum Type { |
||||
GAMEPAD |
||||
} |
Loading…
Reference in new issue