//! Controller (Joystick) profiles /*! * Eases handling of a few common joysticks (for now only Microsoft's XBox 360, but more will be added) */ /* * Copyright (C) 2010 Alejandro Valenzuela Roca, , http://lj9.mexinetica.com/ * * This file is part of MotorJ, a free framework for videogame development. * * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef CONTROLLERPROFILES_H #ifdef WIN32 //0: A #define XBOX360_A 0 //1: B #define XBOX360_B 1 //2: X #define XBOX360_X 2 //3: Y #define XBOX360_Y 3 //4: LB #define XBOX360_LB 4 //5: RB #define XBOX360_RB 5 //6: Back #define XBOX360_BACK 6 //7: Start #define XBOX360_START 7 //8: Left Stick #define XBOX360_LSTICK 8 //9: Right stick #define XBOX360_RSTICK 9 //First stick axis X #define XBOX360_X0 0 //First stick axis Y #define XBOX360_Y0 1 #ifndef VISUAL_STUDIO //Second stick axis X #define XBOX360_X1 4 //Second stick axis Y #define XBOX360_Y1 3 //Left trigger axis #define XBOX360_LT 2 //Right trigger axis #define XBOX360_RT 5 #else //Second stick axis X #define XBOX360_X1 4 //Second stick axis Y #define XBOX360_Y1 3 //Left trigger axis #define XBOX360_LT 2 //Right trigger axis #define XBOX360_RT 5 #endif //FIXME D-pad is unknown in windows for the time being #endif #ifdef GNU_LINUX //0: PadUP #define XBOX360_UP 0 //1: PadDOWN #define XBOX360_DOWN 1 //2: PadLEFT #define XBOX360_LEFT 2 //3: PadRIGHT #define XBOX360_RIGHT 3 //4: Start #define XBOX360_START 6 //5: Back #define XBOX360_BACK 10 //6: Left stick pressed #define XBOX360_LSTICK 8 //7: Right stick pressed #define XBOX360_RSTICK 9 #define XBOX360_XLOGO 7 //8: LB #define XBOX360_LB 4 //9: RB #define XBOX360_RB 5 //11: A #define XBOX360_A 0 //12: B #define XBOX360_B 1 //13: X #define XBOX360_X 2 //14: Y #define XBOX360_Y 3 //Axes //First stick axis X #define XBOX360_X0 0 //First stick axis Y #define XBOX360_Y0 1 //Second stick axis X #define XBOX360_X1 3 //Second stick axis Y #define XBOX360_Y1 4 //Left trigger axis #define XBOX360_LT 2 //Right trigger axis #define XBOX360_RT 5 #endif #ifdef MAC //0: PadUP #define XBOX360_UP 0 //1: PadDOWN #define XBOX360_DOWN 1 //2: PadLEFT #define XBOX360_LEFT 2 //3: PadRIGHT #define XBOX360_RIGHT 3 //4: Start #define XBOX360_START 4 //5: Back #define XBOX360_BACK 5 //6: Left stick pressed #define XBOX360_LSTICK 6 //7: Right stick pressed #define XBOX360_RSTICK 7 //8: LB #define XBOX360_LB 8 //9: RB #define XBOX360_RB 9 //11: A #define XBOX360_A 11 //12: B #define XBOX360_B 12 //13: X #define XBOX360_X 13 //14: Y #define XBOX360_Y 14 //Axes //First stick axis X #define XBOX360_X0 0 //First stick axis Y #define XBOX360_Y0 1 //Second stick axis X #define XBOX360_X1 2 //Second stick axis Y #define XBOX360_Y1 3 //Left trigger axis #define XBOX360_LT 4 //Right trigger axis #define XBOX360_RT 5 #endif #endif