X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fjoystick.h;h=a48c2bb39f2d54d212fc4bb25f41aab51ad54249;hp=56c5b43d939379b456cae79449c59b01440fbebb;hb=8d46c5298f0fcce7bdb52f3835b2fbbdc403dfe0;hpb=823bddb0d9cc63ddda17a2cd20266aa3b82bde38 diff --git a/src/joystick.h b/src/joystick.h index 56c5b43d..a48c2bb3 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -23,20 +23,26 @@ #include #define DEV_JOYSTICK_0 "/dev/joy0" #define DEV_JOYSTICK_1 "/dev/joy1" +#define DEV_JOYSTICK_2 "/dev/joy2" +#define DEV_JOYSTICK_3 "/dev/joy3" #else #define DEV_JOYSTICK_0 "/dev/js0" #define DEV_JOYSTICK_1 "/dev/js1" +#define DEV_JOYSTICK_2 "/dev/js2" +#define DEV_JOYSTICK_3 "/dev/js3" #endif /* get these values from the program 'js' from the joystick package, */ /* set JOYSTICK_PERCENT to a threshold appropriate for your joystick */ #define JOYSTICK_XLEFT 30 -#define JOYSTICK_XRIGHT 1250 #define JOYSTICK_XMIDDLE 530 +#define JOYSTICK_XRIGHT 1250 #define JOYSTICK_YUPPER 40 -#define JOYSTICK_YLOWER 1440 #define JOYSTICK_YMIDDLE 680 +#define JOYSTICK_YLOWER 1440 + #define JOYSTICK_PERCENT 25 + #define JOY_LEFT MV_LEFT #define JOY_RIGHT MV_RIGHT #define JOY_UP MV_UP @@ -44,6 +50,7 @@ #define JOY_BUTTON_1 (1<<4) #define JOY_BUTTON_2 (1<<5) #define JOY_BUTTON (JOY_BUTTON_1 | JOY_BUTTON_2) + #define JOY_BUTTON_NOT_PRESSED 0 #define JOY_BUTTON_PRESSED 1 #define JOY_BUTTON_NEW_PRESSED 2 @@ -57,8 +64,9 @@ void CheckJoystickData(void); -int JoystickPosition(int, int, int); -int Joystick(void); -int JoystickButton(void); +int Joystick(int); +int JoystickButton(int); +int AnyJoystick(void); +int AnyJoystickButton(void); #endif