From f81b9077d13b614262556a7401068f016fe2b365 Mon Sep 17 00:00:00 2001 From: Sascha Hlusiak Date: Sun, 28 Dec 2008 17:28:50 +0100 Subject: [PATCH] Export JSTK_* constants with joystick-properties.h --- include/joystick-properties.h | 27 +++++++++++++++++++++++++++ src/jstk.h | 23 +---------------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/include/joystick-properties.h b/include/joystick-properties.h index 178df26..603394d 100644 --- a/include/joystick-properties.h +++ b/include/joystick-properties.h @@ -30,6 +30,33 @@ */ + +/** To be used with property JSTK_PROP_AXIS_TYPE **/ +typedef enum _JSTK_TYPE { + JSTK_TYPE_NONE=0, /* Axis value is not relevant */ + JSTK_TYPE_BYVALUE, /* Speed of cursor is relative to amplitude */ + JSTK_TYPE_ACCELERATED, /* Speed is accelerated */ + JSTK_TYPE_ABSOLUTE /* The amplitude defines the cursor position */ +} JSTK_TYPE; + + +/** To be used with properties JSTK_PROP_AXIS_MAPPING, JSTK_PROP_BUTTON_MAPPING */ +typedef enum _JSTK_MAPPING { + JSTK_MAPPING_NONE=0, /* Nothing */ + JSTK_MAPPING_X, /* X-Axis */ + JSTK_MAPPING_Y, /* Y-Axis */ + JSTK_MAPPING_ZX, /* Horizontal scrolling */ + JSTK_MAPPING_ZY, /* Vertical scrolling */ + JSTK_MAPPING_BUTTON, /* Mouse button */ + JSTK_MAPPING_KEY, /* Keyboard event */ + JSTK_MAPPING_SPEED_MULTIPLY, /* Will amplify all axis movement */ + JSTK_MAPPING_DISABLE, /* Disable mouse and key events */ + JSTK_MAPPING_DISABLE_MOUSE, /* Disable only mouse events */ + JSTK_MAPPING_DISABLE_KEYS /* Disable only key events */ +} JSTK_MAPPING; + + + /** Controls the verbosity of the driver */ /* 8 bit (0..20) */ #define JSTK_PROP_DEBUGLEVEL "Debug Level" diff --git a/src/jstk.h b/src/jstk.h index 3e8d891..694ae45 100644 --- a/src/jstk.h +++ b/src/jstk.h @@ -26,6 +26,7 @@ #include #include +#include "joystick-properties.h" /* definitions */ #define MAXBUTTONS 32 @@ -68,28 +69,6 @@ typedef void(*jstkCloseDeviceProc)(JoystickDevPtr joystick); typedef int(*jstkReadDataProc)(JoystickDevPtr joystick, JOYSTICKEVENT *event, int *number); - -typedef enum _JSTK_TYPE { - JSTK_TYPE_NONE=0, /* Axis value is not relevant */ - JSTK_TYPE_BYVALUE, /* Speed of cursor is relative to amplitude */ - JSTK_TYPE_ACCELERATED, /* Speed is accelerated */ - JSTK_TYPE_ABSOLUTE /* The amplitude defines the cursor position */ -} JSTK_TYPE; - -typedef enum _JSTK_MAPPING { - JSTK_MAPPING_NONE=0, /* Nothing */ - JSTK_MAPPING_X, /* X-Axis */ - JSTK_MAPPING_Y, /* Y-Axis */ - JSTK_MAPPING_ZX, /* Horizontal scrolling */ - JSTK_MAPPING_ZY, /* Vertical scrolling */ - JSTK_MAPPING_BUTTON, /* Mouse button */ - JSTK_MAPPING_KEY, /* Keyboard event */ - JSTK_MAPPING_SPEED_MULTIPLY, /* Will amplify all axis movement */ - JSTK_MAPPING_DISABLE, /* Disable mouse and key events */ - JSTK_MAPPING_DISABLE_MOUSE, /* Disable only mouse events */ - JSTK_MAPPING_DISABLE_KEYS /* Disable only key events */ -} JSTK_MAPPING; - typedef unsigned int KEYSCANCODES [MAXKEYSPERBUTTON]; typedef struct _AXIS {