comparison src/joystick/linux/SDL_sysjoystick.c @ 2489:96adc8025331 gsoc2008_force_feedback

Exposed some of the joystick stuff to the haptic subsystem. Added SDL_JoystickIsHaptic().
author Edgar Simo <bobbens@gmail.com>
date Wed, 02 Jul 2008 08:24:35 +0000
parents a5de28552be4
children be9b206d44af
comparison
equal deleted inserted replaced
2488:8e2bdbccf7ff 2489:96adc8025331
29 #include <unistd.h> 29 #include <unistd.h>
30 #include <fcntl.h> 30 #include <fcntl.h>
31 #include <sys/ioctl.h> 31 #include <sys/ioctl.h>
32 #include <limits.h> /* For the definition of PATH_MAX */ 32 #include <limits.h> /* For the definition of PATH_MAX */
33 #include <linux/joystick.h> 33 #include <linux/joystick.h>
34 #if SDL_INPUT_LINUXEV
35 #include <linux/input.h>
36 #endif
37 34
38 #include "SDL_joystick.h" 35 #include "SDL_joystick.h"
39 #include "../SDL_sysjoystick.h" 36 #include "../SDL_sysjoystick.h"
40 #include "../SDL_joystick_c.h" 37 #include "../SDL_joystick_c.h"
38 #include "SDL_sysjoystick_c.h"
41 39
42 /* Special joystick configurations */ 40 /* Special joystick configurations */
43 static struct 41 static struct
44 { 42 {
45 const char *name; 43 const char *name;
276 int logicalno; 274 int logicalno;
277 #endif /* USE_LOGICAL_JOYSTICKS */ 275 #endif /* USE_LOGICAL_JOYSTICKS */
278 } SDL_joylist[MAX_JOYSTICKS]; 276 } SDL_joylist[MAX_JOYSTICKS];
279 277
280 278
281 /* The private structure used to keep track of a joystick */
282 struct joystick_hwdata
283 {
284 int fd;
285 /* The current linux joystick driver maps hats to two axes */
286 struct hwdata_hat
287 {
288 int axis[2];
289 } *hats;
290 /* The current linux joystick driver maps balls to two axes */
291 struct hwdata_ball
292 {
293 int axis[2];
294 } *balls;
295
296 /* Support for the Linux 2.4 unified input interface */
297 #if SDL_INPUT_LINUXEV
298 SDL_bool is_hid;
299 Uint8 key_map[KEY_MAX - BTN_MISC];
300 Uint8 abs_map[ABS_MAX];
301 struct axis_correct
302 {
303 int used;
304 int coef[3];
305 } abs_correct[ABS_MAX];
306 #endif
307 };
308
309
310 #ifndef NO_LOGICAL_JOYSTICKS 279 #ifndef NO_LOGICAL_JOYSTICKS
311 280
312 static int 281 static int
313 CountLogicalJoysticks(int max) 282 CountLogicalJoysticks(int max)
314 { 283 {