@@ -0,0 +1,951 @@
+package com.thegongoliers.input.joystick;%0A%0Aimport edu.wpi.first.wpilibj.Joystick;%0Aimport edu.wpi.first.wpilibj2.command.button.Button;%0A%0A/**%0A * Adapted from Josh Pordon's gist on GitHub.%0A * https://gist.github.com/pordonj/970b2c189cc6ee06388b3e2f12abcb72%0A */%0Apublic class DPadButton extends Button %7B%0A%0A    private final Joystick mJoystick;%0A    private final Direction mDirection;%0A%0A    public DPadButton(Joystick joystick, Direction direction) %7B%0A        this.mJoystick = joystick;%0A        this.mDirection = direction;%0A    %7D%0A%0A    public enum Direction %7B%0A        UP(0), RIGHT(90), DOWN(180), LEFT(270);%0A        int direction;%0A%0A        Direction(int direction) %7B%0A            this.direction = direction;%0A        %7D%0A    %7D%0A%0A    public boolean get() %7B%0A        int dPadValue = mJoystick.getPOV();%0A        return (dPadValue == mDirection.direction) %7C%7C (dPadValue == (mDirection.direction + 45) %25 360) %7C%7C (dPadValue == (mDirection.direction + 315) %25 360);%0A    %7D%0A%0A%7D%0A

Add D-Pad button