i am quite new to SDL and have a problem with my Device. Actually i have a X-Box Gamepad and a Joystick connected to my computer. Both of them are detected well and all functions like SDL_JoystickNumAxes … work fine.
Now i have some foot pedals (to accelerate, to break and to gang my virtual car) connected to my computer. I thought that SDL_Joystick also recognize them as Joystick. But nothing happens. As a reference i used the libjoystick library (http://libjoystick.sourceforge.net/) to connect my foot pedals and this worked fine. The lib recognized the pedals as joystick and i could read all axes.
But for my project the libjoystick library is quite uncomfortable to use and i want that foot pedals to run with SDL.
Has someone already made any experience with foot pedals and SDL or can tell me what i am doing wrong ??
Perhaps i should give some additional Information about my System: Im using Ubuntu 12.04 32 Bit. My gamepas is recognized and connected to \dev\input\js0. The foot pedals are connected to \dev\input\js4. I thought that SDL_JoystickOpen(int p_inputDevice) references the js File with the given p_inputDevice as Number. For example: SDL_JoystickOpen(4) references \dev\input\js4.
If that is true SDL seems to seperate between foot pedals and joysticks. But i there a way to read out the foot pedals values ?
I wouldn’t assume that the js# devices map directly to the SDL joysticks
(though they might). Did you enumerate all of the joysticks in your code
to see what they are? Try looping from 0 to (SDL_NumJoysticks() - 1) with
something like the code here: http://www.libsdl.org/docs/html/sdljoystickopen.html
What about multimouse,multikeyboard etc?On Sat, Jul 14, 2012 at 8:10 AM, Jonathan Dearborn wrote:
I wouldn’t assume that the js# devices map directly to the SDL joysticks
(though they might). Did you enumerate all of the joysticks in your code to
see what they are? Try looping from 0 to (SDL_NumJoysticks() - 1) with
something like the code here: http://www.libsdl.org/docs/html/sdljoystickopen.html
On Sat, Jul 14, 2012 at 8:10 AM, Jonathan Dearborn wrote:
I wouldn’t assume that the js# devices map directly to the SDL joysticks
(though they might). Did you enumerate all of the joysticks in your code to
see what they are? Try looping from 0 to (SDL_NumJoysticks() - 1) with
something like the code here: http://www.libsdl.org/docs/html/sdljoystickopen.html