Hi,

the current joystick input driver module is not working correctly.

running "dfbinfo" on a "Logitech RumblePad 2"  I'm getting:

Input (02) Joystick                        (primary joystick)
   Type: JOYSTICK
   Caps: AXES BUTTONS
   Max. Axis: 8154629
   Max. Button: 9715979

with the attached patch I'm getting the following result:

Input (02) Logitech Logitech RumblePad 2 USB  (primary joystick)
   Type: JOYSTICK
   Caps: AXES BUTTONS
   Max. Axis: 5
   Max. Button: 11

As you can notice in the patch I did two extra things:

- changed  "DFB_INPUT_DEVICE_DESC_NAME_LENGTH" from 32 to 40
- changed the vendor string from "unkown" to ""

if the patch is correct can it be applied on the 1.4.x branch too?

regards
Haithem.

-- 
*
"If you ask a question - you will be a fool for 5 minutes, otherwise
ignorant for rest of your life"
*
diff --git a/include/directfb.h b/include/directfb.h
index ab94b10..28c54b0 100644
--- a/include/directfb.h
+++ b/include/directfb.h
@@ -1542,7 +1542,7 @@ typedef struct {
 } DFBScreenDescription;
 
 
-#define DFB_INPUT_DEVICE_DESC_NAME_LENGTH    32
+#define DFB_INPUT_DEVICE_DESC_NAME_LENGTH    40
 #define DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH  40
 
 /*
diff --git a/inputdrivers/joystick/joystick.c b/inputdrivers/joystick/joystick.c
index 807c455..f7df8ee 100644
--- a/inputdrivers/joystick/joystick.c
+++ b/inputdrivers/joystick/joystick.c
@@ -191,9 +191,9 @@ driver_open_device( CoreInputDevice      *device,
                     InputDeviceInfo  *info,
                     void            **driver_data )
 {
-     int           fd, buttons, axes;
+     int           fd;
      JoystickData *data;
-     char          devicename[20];
+     char          buttons, axes, devicename[20];
 
      /* open the right device */
      snprintf( devicename, 20, "/dev/js%d", number );
@@ -216,11 +216,10 @@ driver_open_device( CoreInputDevice      *device,
      ioctl( fd, JSIOCGAXES, &axes );
 
      /* fill device info structure */
-     snprintf( info->desc.name,
-               DFB_INPUT_DEVICE_DESC_NAME_LENGTH, "Joystick" );
+     ioctl( fd, JSIOCGNAME(DFB_INPUT_DEVICE_DESC_NAME_LENGTH), info->desc.name);
 
      snprintf( info->desc.vendor,
-               DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "Unknown" );
+               DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "" );
 
      info->prefered_id     = DIDID_JOYSTICK;
 
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to