namespace Gamepad {

    // Button IDs for canonical (read: "XBox"/"PS") controllers.
    // These are used by auto-configure.
    enum ButtonId {
        BUTTON_LEFT = 1,
        BUTTON_RIGHT = 2,
        BUTTON_UP = 3,
        BUTTON_DOWN = 4,
        DPAD = 5,
        AXIS1 = 6,
        AXIS2 = 7,
        LEFT_TRIGGER = 8,
        RIGHT_TRIGGER = 9,
        LEFT_BUMPER = 10,
        RIGHT_BUMPER = 11,
        START = 12,
        BACK = 13,
        AXIS1_BUTTON = 14,
        AXIS2_BUTTON = 15,
    }

    enum XBoxButtonId {
        X = ButtonId.BUTTON_LEFT,
        B = ButtonId.BUTTON_RIGHT,
        Y = ButtonId.BUTTON_UP,
        A = ButtonId.BUTTON_DOWN,
        DPAD = ButtonId.DPAD,
        AXIS1 = ButtonId.AXIS1,
        AXIS2 = ButtonId.AXIS2,
        AXIS1_BUTTON = ButtonId.AXIS1_BUTTON,
        AXIS2_BUTTON = ButtonId.AXIS2_BUTTON,
        LEFT_TRIGGER = ButtonId.LEFT_TRIGGER,
        RIGHT_TRIGGER = ButtonId.RIGHT_TRIGGER,
        LEFT_BUMPER = ButtonId.LEFT_BUMPER,
        RIGHT_BUMPER = ButtonId.RIGHT_BUMPER,
        START = ButtonId.START,
        BACK = ButtonId.BACK,
    }

    enum PsButtonId {
        SQUARE = ButtonId.BUTTON_LEFT,
        CIRCLE = ButtonId.BUTTON_RIGHT,
        TRIANGLE = ButtonId.BUTTON_UP,
        X = ButtonId.BUTTON_DOWN,
        DPAD = ButtonId.DPAD,
        AXIS1 = ButtonId.AXIS1,
        AXIS2 = ButtonId.AXIS2,
        LEFT_BUMPER2 = ButtonId.LEFT_TRIGGER,
        RIGHT_BUMPER2 = ButtonId.RIGHT_TRIGGER,
        LEFT_BUMPER1 = ButtonId.LEFT_BUMPER,
        RIGHT_BUMPER1 = ButtonId.RIGHT_BUMPER,
        START = ButtonId.START,
        SELECT = ButtonId.BACK,
    }

    enum SnesButtonId {
        Y = ButtonId.BUTTON_LEFT,
        A = ButtonId.BUTTON_RIGHT,
        X = ButtonId.BUTTON_UP,
        B = ButtonId.BUTTON_DOWN,
        DPAD = ButtonId.DPAD,
        L = ButtonId.LEFT_BUMPER,
        R = ButtonId.RIGHT_BUMPER,
        START = ButtonId.START,
        SELECT = ButtonId.BACK,
    }
}
