Ok, in a very simplified version ive got to write a C++ app to interface with a joystick and play various sounds depending on its position - Its a USB joystick and I will have a QT GUI.

This app already exists, for Windows/C# . I just need help porting it to C++/Linux.

Specifically, how to do the joystick and sound? Any ideas for libaries?

7 Years
Discussion Span
Last Post by jbennet

A google search on alsa api returns many useful links. I am not familiar with Windows/C# audio model, so I don't know how well it is mapped onto alsa.

Regarding joystick, it is seen by the system as a serial device; you need to open it, query it with some ioctls (JSIOCGAXES and JSIOCGBUTTONS), and then just read struct js_event (see linux/joystick.h for reference).

Votes + Comments
fairly helpfulish

Most likely. The code is based on a fairly old kernel, but AFAIK not much has been changed since then.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.