All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.badlogic.gdx.controllers.desktop.support.JamepadMapping Maven / Gradle / Ivy

There is a newer version: 2.2.3
Show newest version
package com.badlogic.gdx.controllers.desktop.support;

import com.badlogic.gdx.controllers.ControllerMapping;
import com.studiohartman.jamepad.ControllerAxis;
import com.studiohartman.jamepad.ControllerButton;

public class JamepadMapping extends ControllerMapping {
    private static JamepadMapping instance;

    JamepadMapping() {
        super(ControllerAxis.LEFTX.ordinal(), ControllerAxis.LEFTY.ordinal(),
                ControllerAxis.RIGHTX.ordinal(), ControllerAxis.RIGHTY.ordinal(),
                ControllerButton.A.ordinal(), ControllerButton.B.ordinal(),
                ControllerButton.X.ordinal(), ControllerButton.Y.ordinal(),
                ControllerButton.BACK.ordinal(), ControllerButton.START.ordinal(),
                ControllerButton.LEFTBUMPER.ordinal(), UNDEFINED,
                ControllerButton.RIGHTBUMPER.ordinal(), UNDEFINED,
                ControllerButton.LEFTSTICK.ordinal(), ControllerButton.RIGHTSTICK.ordinal(),
                ControllerButton.DPAD_UP.ordinal(), ControllerButton.DPAD_DOWN.ordinal(),
                ControllerButton.DPAD_LEFT.ordinal(), ControllerButton.DPAD_RIGHT.ordinal());
    }

    static JamepadMapping getInstance() {
        if (instance == null)
            instance = new JamepadMapping();

        return instance;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy