src/joystick/linux/SDL_sysjoystick.c
changeset 12088 399cc39583cc
parent 11811 5d94cb6b24d3
child 12090 c3209fca27b2
equal deleted inserted replaced
12087:cb546477e34f 12088:399cc39583cc
    27 #endif
    27 #endif
    28 
    28 
    29 /* This is the Linux implementation of the SDL joystick API */
    29 /* This is the Linux implementation of the SDL joystick API */
    30 
    30 
    31 #include <sys/stat.h>
    31 #include <sys/stat.h>
       
    32 #include <errno.h>              /* errno, strerror */
       
    33 #include <fcntl.h>
       
    34 #include <limits.h>             /* For the definition of PATH_MAX */
       
    35 #include <sys/ioctl.h>
    32 #include <unistd.h>
    36 #include <unistd.h>
    33 #include <fcntl.h>
       
    34 #include <sys/ioctl.h>
       
    35 #include <limits.h>             /* For the definition of PATH_MAX */
       
    36 #include <linux/joystick.h>
    37 #include <linux/joystick.h>
    37 
    38 
    38 #include "SDL_assert.h"
    39 #include "SDL_assert.h"
    39 #include "SDL_joystick.h"
    40 #include "SDL_joystick.h"
    40 #include "SDL_endian.h"
    41 #include "SDL_endian.h"
    41 #include "../../events/SDL_events_c.h"
    42 #include "../../events/SDL_events_c.h"
    42 #include "../SDL_sysjoystick.h"
    43 #include "../SDL_sysjoystick.h"
    43 #include "../SDL_joystick_c.h"
    44 #include "../SDL_joystick_c.h"
    44 #include "../steam/SDL_steamcontroller.h"
    45 #include "../steam/SDL_steamcontroller.h"
    45 #include "SDL_sysjoystick_c.h"
    46 #include "SDL_sysjoystick_c.h"
       
    47 #include "../hidapi/SDL_hidapijoystick_c.h"
    46 
    48 
    47 /* This isn't defined in older Linux kernel headers */
    49 /* This isn't defined in older Linux kernel headers */
    48 #ifndef SYN_DROPPED
    50 #ifndef SYN_DROPPED
    49 #define SYN_DROPPED 3
    51 #define SYN_DROPPED 3
    50 #endif
    52 #endif
    74 } SDL_joylist_item;
    76 } SDL_joylist_item;
    75 
    77 
    76 static SDL_joylist_item *SDL_joylist = NULL;
    78 static SDL_joylist_item *SDL_joylist = NULL;
    77 static SDL_joylist_item *SDL_joylist_tail = NULL;
    79 static SDL_joylist_item *SDL_joylist_tail = NULL;
    78 static int numjoysticks = 0;
    80 static int numjoysticks = 0;
    79 static int instance_counter = 0;
       
    80 
    81 
    81 
    82 
    82 #define test_bit(nr, addr) \
    83 #define test_bit(nr, addr) \
    83     (((1UL << ((nr) % (sizeof(long) * 8))) & ((addr)[(nr) / (sizeof(long) * 8)])) != 0)
    84     (((1UL << ((nr) % (sizeof(long) * 8))) & ((addr)[(nr) / (sizeof(long) * 8)])) != 0)
    84 #define NBITS(x) ((((x)-1)/(sizeof(long) * 8))+1)
    85 #define NBITS(x) ((((x)-1)/(sizeof(long) * 8))+1)
   207 
   208 
   208     if (ioctl(fd, EVIOCGID, &inpid) < 0) {
   209     if (ioctl(fd, EVIOCGID, &inpid) < 0) {
   209         return 0;
   210         return 0;
   210     }
   211     }
   211 
   212 
       
   213 #ifdef SDL_JOYSTICK_HIDAPI
       
   214     if (HIDAPI_IsDevicePresent(inpid.vendor, inpid.product)) {
       
   215         /* The HIDAPI driver is taking care of this device */
       
   216         return 0;
       
   217     }
       
   218 #endif
       
   219 
   212     /* Check the joystick blacklist */
   220     /* Check the joystick blacklist */
   213     id = MAKE_VIDPID(inpid.vendor, inpid.product);
   221     id = MAKE_VIDPID(inpid.vendor, inpid.product);
   214     for (i = 0; i < SDL_arraysize(joystick_blacklist); ++i) {
   222     for (i = 0; i < SDL_arraysize(joystick_blacklist); ++i) {
   215         if (id == joystick_blacklist[i]) {
   223         if (id == joystick_blacklist[i]) {
   216             return 0;
   224             return 0;
   237         *guid16++ = 0;
   245         *guid16++ = 0;
   238     } else {
   246     } else {
   239         SDL_strlcpy((char*)guid16, namebuf, sizeof(guid->data) - 4);
   247         SDL_strlcpy((char*)guid16, namebuf, sizeof(guid->data) - 4);
   240     }
   248     }
   241 
   249 
   242     if (SDL_IsGameControllerNameAndGUID(namebuf, *guid) &&
   250     if (SDL_ShouldIgnoreJoystick(namebuf, *guid)) {
   243         SDL_ShouldIgnoreGameController(namebuf, *guid)) {
       
   244         return 0;
   251         return 0;
   245     }
   252     }
   246     return 1;
   253     return 1;
   247 }
   254 }
   248 
   255 
   323     item->devnum = sb.st_rdev;
   330     item->devnum = sb.st_rdev;
   324     item->path = SDL_strdup(path);
   331     item->path = SDL_strdup(path);
   325     item->name = SDL_strdup(namebuf);
   332     item->name = SDL_strdup(namebuf);
   326     item->guid = guid;
   333     item->guid = guid;
   327 
   334 
   328     if ( (item->path == NULL) || (item->name == NULL) ) {
   335     if ((item->path == NULL) || (item->name == NULL)) {
   329          SDL_free(item->path);
   336          SDL_free(item->path);
   330          SDL_free(item->name);
   337          SDL_free(item->name);
   331          SDL_free(item);
   338          SDL_free(item);
   332          return -1;
   339          return -1;
   333     }
   340     }
   334 
   341 
   335     item->device_instance = instance_counter++;
   342     item->device_instance = SDL_GetNextJoystickInstanceID();
   336     if (SDL_joylist_tail == NULL) {
   343     if (SDL_joylist_tail == NULL) {
   337         SDL_joylist = SDL_joylist_tail = item;
   344         SDL_joylist = SDL_joylist_tail = item;
   338     } else {
   345     } else {
   339         SDL_joylist_tail->next = item;
   346         SDL_joylist_tail->next = item;
   340         SDL_joylist_tail = item;
   347         SDL_joylist_tail = item;
   341     }
   348     }
   342 
   349 
   343     /* Need to increment the joystick count before we post the event */
   350     /* Need to increment the joystick count before we post the event */
   344     ++numjoysticks;
   351     ++numjoysticks;
   345 
   352 
   346     SDL_PrivateJoystickAdded(numjoysticks - 1);
   353     SDL_PrivateJoystickAdded(item->device_instance);
   347 
   354 
   348     return numjoysticks;
   355     return numjoysticks;
   349 }
   356 }
   350 
   357 
   351 #if SDL_USE_LIBUDEV
   358 #if SDL_USE_LIBUDEV
   407     for (i = 0; i < 32; i++) {
   414     for (i = 0; i < 32; i++) {
   408         SDL_snprintf(path, SDL_arraysize(path), "/dev/input/event%d", i);
   415         SDL_snprintf(path, SDL_arraysize(path), "/dev/input/event%d", i);
   409         MaybeAddDevice(path);
   416         MaybeAddDevice(path);
   410     }
   417     }
   411 
   418 
   412     return numjoysticks;
   419     return 0;
   413 }
   420 }
   414 #endif
   421 #endif
   415 
   422 
   416 #if SDL_USE_LIBUDEV
   423 #if SDL_USE_LIBUDEV
   417 static int
   424 static int
   428     }
   435     }
   429     
   436     
   430     /* Force a scan to build the initial device list */
   437     /* Force a scan to build the initial device list */
   431     SDL_UDEV_Scan();
   438     SDL_UDEV_Scan();
   432 
   439 
   433     return numjoysticks;
   440     return 0;
   434 }
   441 }
   435 #endif
   442 #endif
   436 
   443 
   437 static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_JoystickGUID guid, int *device_instance)
   444 static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_JoystickGUID guid, int *device_instance)
   438 {
   445 {
   453          SDL_free(item->name);
   460          SDL_free(item->name);
   454          SDL_free(item);
   461          SDL_free(item);
   455          return SDL_FALSE;
   462          return SDL_FALSE;
   456     }
   463     }
   457 
   464 
   458     *device_instance = item->device_instance = instance_counter++;
   465     *device_instance = item->device_instance = SDL_GetNextJoystickInstanceID();
   459     if (SDL_joylist_tail == NULL) {
   466     if (SDL_joylist_tail == NULL) {
   460         SDL_joylist = SDL_joylist_tail = item;
   467         SDL_joylist = SDL_joylist_tail = item;
   461     } else {
   468     } else {
   462         SDL_joylist_tail->next = item;
   469         SDL_joylist_tail->next = item;
   463         SDL_joylist_tail = item;
   470         SDL_joylist_tail = item;
   464     }
   471     }
   465 
   472 
   466     /* Need to increment the joystick count before we post the event */
   473     /* Need to increment the joystick count before we post the event */
   467     ++numjoysticks;
   474     ++numjoysticks;
   468 
   475 
   469     SDL_PrivateJoystickAdded(numjoysticks - 1);
   476     SDL_PrivateJoystickAdded(item->device_instance);
   470 
   477 
   471     return SDL_TRUE;
   478     return SDL_TRUE;
   472 }
   479 }
   473 
   480 
   474 static void SteamControllerDisconnectedCallback(int device_instance)
   481 static void SteamControllerDisconnectedCallback(int device_instance)
   503         }
   510         }
   504         prev = item;
   511         prev = item;
   505     }
   512     }
   506 }
   513 }
   507 
   514 
   508 int
   515 static int
   509 SDL_SYS_JoystickInit(void)
   516 LINUX_JoystickInit(void)
   510 {
   517 {
   511     /* First see if the user specified one or more joysticks to use */
   518     /* First see if the user specified one or more joysticks to use */
   512     if (SDL_getenv("SDL_JOYSTICK_DEVICE") != NULL) {
   519     if (SDL_getenv("SDL_JOYSTICK_DEVICE") != NULL) {
   513         char *envcopy, *envpath, *delim;
   520         char *envcopy, *envpath, *delim;
   514         envcopy = SDL_strdup(SDL_getenv("SDL_JOYSTICK_DEVICE"));
   521         envcopy = SDL_strdup(SDL_getenv("SDL_JOYSTICK_DEVICE"));
   532 #else 
   539 #else 
   533     return JoystickInitWithoutUdev();
   540     return JoystickInitWithoutUdev();
   534 #endif
   541 #endif
   535 }
   542 }
   536 
   543 
   537 int
   544 static int
   538 SDL_SYS_NumJoysticks(void)
   545 LINUX_JoystickGetCount(void)
   539 {
   546 {
   540     return numjoysticks;
   547     return numjoysticks;
   541 }
   548 }
   542 
   549 
   543 void
   550 static void
   544 SDL_SYS_JoystickDetect(void)
   551 LINUX_JoystickDetect(void)
   545 {
   552 {
   546 #if SDL_USE_LIBUDEV
   553 #if SDL_USE_LIBUDEV
   547     SDL_UDEV_Poll();
   554     SDL_UDEV_Poll();
   548 #endif
   555 #endif
   549 
   556 
   567 
   574 
   568     return item;
   575     return item;
   569 }
   576 }
   570 
   577 
   571 /* Function to get the device-dependent name of a joystick */
   578 /* Function to get the device-dependent name of a joystick */
   572 const char *
   579 static const char *
   573 SDL_SYS_JoystickNameForDeviceIndex(int device_index)
   580 LINUX_JoystickGetDeviceName(int device_index)
   574 {
   581 {
   575     return JoystickByDevIndex(device_index)->name;
   582     return JoystickByDevIndex(device_index)->name;
   576 }
   583 }
   577 
   584 
       
   585 static SDL_JoystickGUID
       
   586 LINUX_JoystickGetDeviceGUID( int device_index )
       
   587 {
       
   588     return JoystickByDevIndex(device_index)->guid;
       
   589 }
       
   590 
   578 /* Function to perform the mapping from device index to the instance id for this index */
   591 /* Function to perform the mapping from device index to the instance id for this index */
   579 SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
   592 static SDL_JoystickID
       
   593 LINUX_JoystickGetDeviceInstanceID(int device_index)
   580 {
   594 {
   581     return JoystickByDevIndex(device_index)->device_instance;
   595     return JoystickByDevIndex(device_index)->device_instance;
   582 }
   596 }
   583 
   597 
   584 static int
   598 static int
   622 {
   636 {
   623     int i, t;
   637     int i, t;
   624     unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
   638     unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
   625     unsigned long absbit[NBITS(ABS_MAX)] = { 0 };
   639     unsigned long absbit[NBITS(ABS_MAX)] = { 0 };
   626     unsigned long relbit[NBITS(REL_MAX)] = { 0 };
   640     unsigned long relbit[NBITS(REL_MAX)] = { 0 };
       
   641     unsigned long ffbit[NBITS(FF_MAX)] = { 0 };
   627 
   642 
   628     /* See if this device uses the new unified event API */
   643     /* See if this device uses the new unified event API */
   629     if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) &&
   644     if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) &&
   630         (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) &&
   645         (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) &&
   631         (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0)) {
   646         (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0)) {
   717             if (allocate_balldata(joystick) < 0) {
   732             if (allocate_balldata(joystick) < 0) {
   718                 joystick->nballs = 0;
   733                 joystick->nballs = 0;
   719             }
   734             }
   720         }
   735         }
   721     }
   736     }
       
   737 
       
   738     if (ioctl(fd, EVIOCGBIT(EV_FF, sizeof(ffbit)), ffbit) >= 0) {
       
   739         if (test_bit(FF_RUMBLE, ffbit)) {
       
   740             joystick->hwdata->ff_rumble = SDL_TRUE;
       
   741         }
       
   742         if (test_bit(FF_SINE, ffbit)) {
       
   743             joystick->hwdata->ff_sine = SDL_TRUE;
       
   744         }
       
   745     }
   722 }
   746 }
   723 
   747 
   724 
   748 
   725 /* Function to open a joystick for use.
   749 /* Function to open a joystick for use.
   726    The joystick to open is specified by the device index.
   750    The joystick to open is specified by the device index.
   727    This should fill the nbuttons and naxes fields of the joystick structure.
   751    This should fill the nbuttons and naxes fields of the joystick structure.
   728    It returns 0, or -1 if there is an error.
   752    It returns 0, or -1 if there is an error.
   729  */
   753  */
   730 int
   754 static int
   731 SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
   755 LINUX_JoystickOpen(SDL_Joystick * joystick, int device_index)
   732 {
   756 {
   733     SDL_joylist_item *item = JoystickByDevIndex(device_index);
   757     SDL_joylist_item *item = JoystickByDevIndex(device_index);
   734 
   758 
   735     if (item == NULL) {
   759     if (item == NULL) {
   736         return SDL_SetError("No such device");
   760         return SDL_SetError("No such device");
   742     if (joystick->hwdata == NULL) {
   766     if (joystick->hwdata == NULL) {
   743         return SDL_OutOfMemory();
   767         return SDL_OutOfMemory();
   744     }
   768     }
   745     joystick->hwdata->item = item;
   769     joystick->hwdata->item = item;
   746     joystick->hwdata->guid = item->guid;
   770     joystick->hwdata->guid = item->guid;
       
   771     joystick->hwdata->effect.id = -1;
   747     joystick->hwdata->m_bSteamController = item->m_bSteamController;
   772     joystick->hwdata->m_bSteamController = item->m_bSteamController;
   748 
   773 
   749     if (item->m_bSteamController) {
   774     if (item->m_bSteamController) {
   750         joystick->hwdata->fd = -1;
   775         joystick->hwdata->fd = -1;
   751         SDL_GetSteamControllerInputs(&joystick->nbuttons,
   776         SDL_GetSteamControllerInputs(&joystick->nbuttons,
   752                                      &joystick->naxes,
   777                                      &joystick->naxes,
   753                                      &joystick->nhats);
   778                                      &joystick->nhats);
   754     } else {
   779     } else {
   755         int fd = open(item->path, O_RDONLY, 0);
   780         int fd = open(item->path, O_RDWR, 0);
   756         if (fd < 0) {
   781         if (fd < 0) {
   757             SDL_free(joystick->hwdata);
   782             SDL_free(joystick->hwdata);
   758             joystick->hwdata = NULL;
   783             joystick->hwdata = NULL;
   759             return SDL_SetError("Unable to open %s", item->path);
   784             return SDL_SetError("Unable to open %s", item->path);
   760         }
   785         }
   783 
   808 
   784     return (0);
   809     return (0);
   785 }
   810 }
   786 
   811 
   787 /* Function to determine if this joystick is attached to the system right now */
   812 /* Function to determine if this joystick is attached to the system right now */
   788 SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
   813 static SDL_bool
       
   814 LINUX_JoystickIsAttached(SDL_Joystick *joystick)
   789 {
   815 {
   790     return joystick->hwdata->item != NULL;
   816     return joystick->hwdata->item != NULL;
       
   817 }
       
   818 
       
   819 static int
       
   820 LINUX_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
       
   821 {
       
   822     struct input_event event;
       
   823 
       
   824     if (joystick->hwdata->effect.id < 0) {
       
   825         if (joystick->hwdata->ff_rumble) {
       
   826             struct ff_effect *effect = &joystick->hwdata->effect;
       
   827 
       
   828             effect->type = FF_RUMBLE;
       
   829             effect->replay.length = SDL_min(duration_ms, 32767);
       
   830             effect->u.rumble.strong_magnitude = low_frequency_rumble;
       
   831             effect->u.rumble.weak_magnitude = high_frequency_rumble;
       
   832         } else if (joystick->hwdata->ff_sine) {
       
   833             /* Scale and average the two rumble strengths */
       
   834             Sint16 magnitude = (Sint16)(((low_frequency_rumble / 2) + (high_frequency_rumble / 2)) / 2);
       
   835             struct ff_effect *effect = &joystick->hwdata->effect;
       
   836 
       
   837             effect->type = FF_PERIODIC;
       
   838             effect->replay.length = SDL_min(duration_ms, 32767);
       
   839             effect->u.periodic.waveform = FF_SINE;
       
   840             effect->u.periodic.magnitude = magnitude;
       
   841         } else {
       
   842             return SDL_Unsupported();
       
   843         }
       
   844     }
       
   845 
       
   846     if (ioctl(joystick->hwdata->fd, EVIOCSFF, &joystick->hwdata->effect) < 0) {
       
   847         return SDL_SetError("Couldn't update rumble effect: %s", strerror(errno));
       
   848     }
       
   849 
       
   850     event.type = EV_FF;
       
   851     event.code = joystick->hwdata->effect.id;
       
   852     event.value = 1;
       
   853     if (write(joystick->hwdata->fd, &event, sizeof(event)) < 0) {
       
   854         return SDL_SetError("Couldn't start rumble effect: %s", strerror(errno));
       
   855     }
       
   856     return 0;
   791 }
   857 }
   792 
   858 
   793 static SDL_INLINE void
   859 static SDL_INLINE void
   794 HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
   860 HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
   795 {
   861 {
   961             }
  1027             }
   962         }
  1028         }
   963     }
  1029     }
   964 }
  1030 }
   965 
  1031 
   966 void
  1032 static void
   967 SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
  1033 LINUX_JoystickUpdate(SDL_Joystick * joystick)
   968 {
  1034 {
   969     int i;
  1035     int i;
   970 
  1036 
   971     if (joystick->hwdata->m_bSteamController) {
  1037     if (joystick->hwdata->m_bSteamController) {
   972         SDL_UpdateSteamController(joystick);
  1038         SDL_UpdateSteamController(joystick);
   988         }
  1054         }
   989     }
  1055     }
   990 }
  1056 }
   991 
  1057 
   992 /* Function to close a joystick after use */
  1058 /* Function to close a joystick after use */
   993 void
  1059 static void
   994 SDL_SYS_JoystickClose(SDL_Joystick * joystick)
  1060 LINUX_JoystickClose(SDL_Joystick * joystick)
   995 {
  1061 {
   996     if (joystick->hwdata) {
  1062     if (joystick->hwdata) {
       
  1063         if (joystick->hwdata->effect.id >= 0) {
       
  1064             ioctl(joystick->hwdata->fd, EVIOCRMFF, joystick->hwdata->effect.id);
       
  1065             joystick->hwdata->effect.id = -1;
       
  1066         }
   997         if (joystick->hwdata->fd >= 0) {
  1067         if (joystick->hwdata->fd >= 0) {
   998             close(joystick->hwdata->fd);
  1068             close(joystick->hwdata->fd);
   999         }
  1069         }
  1000         if (joystick->hwdata->item) {
  1070         if (joystick->hwdata->item) {
  1001             joystick->hwdata->item->hwdata = NULL;
  1071             joystick->hwdata->item->hwdata = NULL;
  1006         SDL_free(joystick->hwdata);
  1076         SDL_free(joystick->hwdata);
  1007     }
  1077     }
  1008 }
  1078 }
  1009 
  1079 
  1010 /* Function to perform any system-specific joystick related cleanup */
  1080 /* Function to perform any system-specific joystick related cleanup */
  1011 void
  1081 static void
  1012 SDL_SYS_JoystickQuit(void)
  1082 LINUX_JoystickQuit(void)
  1013 {
  1083 {
  1014     SDL_joylist_item *item = NULL;
  1084     SDL_joylist_item *item = NULL;
  1015     SDL_joylist_item *next = NULL;
  1085     SDL_joylist_item *next = NULL;
  1016 
  1086 
  1017     for (item = SDL_joylist; item; item = next) {
  1087     for (item = SDL_joylist; item; item = next) {
  1022     }
  1092     }
  1023 
  1093 
  1024     SDL_joylist = SDL_joylist_tail = NULL;
  1094     SDL_joylist = SDL_joylist_tail = NULL;
  1025 
  1095 
  1026     numjoysticks = 0;
  1096     numjoysticks = 0;
  1027     instance_counter = 0;
       
  1028 
  1097 
  1029 #if SDL_USE_LIBUDEV
  1098 #if SDL_USE_LIBUDEV
  1030     SDL_UDEV_DelCallback(joystick_udev_callback);
  1099     SDL_UDEV_DelCallback(joystick_udev_callback);
  1031     SDL_UDEV_Quit();
  1100     SDL_UDEV_Quit();
  1032 #endif
  1101 #endif
  1033 
  1102 
  1034     SDL_QuitSteamControllers();
  1103     SDL_QuitSteamControllers();
  1035 }
  1104 }
  1036 
  1105 
  1037 SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
  1106 SDL_JoystickDriver SDL_LINUX_JoystickDriver =
  1038 {
  1107 {
  1039     return JoystickByDevIndex(device_index)->guid;
  1108     LINUX_JoystickInit,
  1040 }
  1109     LINUX_JoystickGetCount,
  1041 
  1110     LINUX_JoystickDetect,
  1042 SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
  1111     LINUX_JoystickGetDeviceName,
  1043 {
  1112     LINUX_JoystickGetDeviceGUID,
  1044     return joystick->hwdata->guid;
  1113     LINUX_JoystickGetDeviceInstanceID,
  1045 }
  1114     LINUX_JoystickOpen,
       
  1115     LINUX_JoystickIsAttached,
       
  1116     LINUX_JoystickRumble,
       
  1117     LINUX_JoystickUpdate,
       
  1118     LINUX_JoystickClose,
       
  1119     LINUX_JoystickQuit,
       
  1120 };
  1046 
  1121 
  1047 #endif /* SDL_JOYSTICK_LINUX */
  1122 #endif /* SDL_JOYSTICK_LINUX */
  1048 
  1123 
  1049 /* vi: set ts=4 sw=4 expandtab: */
  1124 /* vi: set ts=4 sw=4 expandtab: */