DarkJezter
New member
Hi ho everyone. Back as usual, and always excited to see all the interest the project's been enjoying. I noticed that someone had gone through the trouble of getting the force feedback working, and decided to upgrade to the latest svn of the source.
The plugin consistently fails to find the path of the event device on my system, giving the error:
Anyways, after looking at the code, it appears that in Gentoo, or perhaps just with my hardware setup that the entries of the /sys/class folder differ slightly, and the following patch got the code working on my system, but will undoubtedly break the existing implementation.
I'm wondering if there's perhaps a different way that we can track down the proper device file. I mean, we could probably generalize the existing code and make it work for both systems, however, I can't help but wonder if this is inherently an unreliable way of tracking this down. Too bad there's no sign yet of force feedback support in SDL.
So here's the patch I used to get it working, if anyone else is having similar issues try the patch and leave a note on the forum here. I'm curious to see what other distributions this will/will not work with.
The plugin consistently fails to find the path of the event device on my system, giving the error:
Code:
Couldn't find input event for rumble support.
Anyways, after looking at the code, it appears that in Gentoo, or perhaps just with my hardware setup that the entries of the /sys/class folder differ slightly, and the following patch got the code working on my system, but will undoubtedly break the existing implementation.
I'm wondering if there's perhaps a different way that we can track down the proper device file. I mean, we could probably generalize the existing code and make it work for both systems, however, I can't help but wonder if this is inherently an unreliable way of tracking this down. Too bad there's no sign yet of force feedback support in SDL.
So here's the patch I used to get it working, if anyone else is having similar issues try the patch and leave a note on the forum here. I'm curious to see what other distributions this will/will not work with.
Code:
--- trunk/blight_input/plugin.c (revision 234)
+++ trunk/blight_input/plugin.c (working copy)
@@ -1043,10 +1043,10 @@
while ((ep = readdir (dp)))
{
- if (!strncmp(ep->d_name,"input:event",11))
+ if (!strncmp(ep->d_name,"event",5))
{
- sscanf(ep->d_name,"input:%s",temp2);
- sprintf(temp,"/dev/input/%s",temp2);
+ //sscanf(ep->d_name,"input:%s",temp2);
+ sprintf(temp,"/dev/input/%s",ep->d_name);
iFound = 1;
break;
}