forked from Clones/Controlify
guide button
This commit is contained in:
@ -18,6 +18,7 @@ public enum Bind {
|
||||
RIGHT_STICK(state -> state.buttons().rightStick(), "right_stick"),
|
||||
START(state -> state.buttons().start(), "start"),
|
||||
BACK(state -> state.buttons().back(), "back"),
|
||||
GUIDE(state -> state.buttons().guide(), "guide"), // the middle button
|
||||
DPAD_UP(state -> state.buttons().dpadUp(), "dpad_up"),
|
||||
DPAD_DOWN(state -> state.buttons().dpadDown(), "dpad_down"),
|
||||
DPAD_LEFT(state -> state.buttons().dpadLeft(), "dpad_left"),
|
||||
|
@ -5,14 +5,14 @@ import org.lwjgl.glfw.GLFW;
|
||||
public record ButtonState(
|
||||
boolean a, boolean b, boolean x, boolean y,
|
||||
boolean leftBumper, boolean rightBumper,
|
||||
boolean back, boolean start,
|
||||
boolean back, boolean start, boolean guide,
|
||||
boolean dpadUp, boolean dpadDown, boolean dpadLeft, boolean dpadRight,
|
||||
boolean leftStick, boolean rightStick
|
||||
) {
|
||||
public static ButtonState EMPTY = new ButtonState(
|
||||
false, false, false, false,
|
||||
false, false,
|
||||
false, false,
|
||||
false, false, false,
|
||||
false, false, false, false,
|
||||
false, false
|
||||
);
|
||||
@ -32,6 +32,7 @@ public record ButtonState(
|
||||
boolean rightBumper = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER) == GLFW.GLFW_PRESS;
|
||||
boolean back = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_BACK) == GLFW.GLFW_PRESS;
|
||||
boolean start = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_START) == GLFW.GLFW_PRESS;
|
||||
boolean guide = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_GUIDE) == GLFW.GLFW_PRESS;
|
||||
boolean dpadUp = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP) == GLFW.GLFW_PRESS;
|
||||
boolean dpadDown = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN) == GLFW.GLFW_PRESS;
|
||||
boolean dpadLeft = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_LEFT) == GLFW.GLFW_PRESS;
|
||||
@ -39,6 +40,6 @@ public record ButtonState(
|
||||
boolean leftStick = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_LEFT_THUMB) == GLFW.GLFW_PRESS;
|
||||
boolean rightStick = buttons.get(GLFW.GLFW_GAMEPAD_BUTTON_RIGHT_THUMB) == GLFW.GLFW_PRESS;
|
||||
|
||||
return new ButtonState(a, b, x, y, leftBumper, rightBumper, back, start, dpadUp, dpadDown, dpadLeft, dpadRight, leftStick, rightStick);
|
||||
return new ButtonState(a, b, x, y, leftBumper, rightBumper, back, start, guide, dpadUp, dpadDown, dpadLeft, dpadRight, leftStick, rightStick);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user