Linux joysticks not working??

Archives Forums/BlitzMax Bug Reports/Linux joysticks not working??

jondecker76(Posted 2010) [#1]
Hello

I just went and bought some simple gamepads so that I could use them to test my development.

To my surprise, none of the joystick functions work on my linux box (Ubuntu 10.04)
The joysticks are tested and do work in Ubuntu. Both jstest and jscal work fine with the joysticks, and I can confirm that they exist at /dev/input/js0 and /dev/input/js1

Is this a known problem?


jondecker76(Posted 2010) [#2]
Can a moderator move this to bug reports??


I found the problem in pub.freejoy/freejoy.linux.c

line 73 needs changed from
	sprintf(fname,"/dev/js%d",n);


to

	sprintf(fname,"/dev/input/js%d",n);


I wonder if this is a sane default for most recent Linux distros?
If not, then I propose a new function to set the path!


Scienthsine(Posted 2011) [#3]
This was very helpful, had to do the same here.