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?

Recommended Answers

All 5 Replies

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).

commented: fairly helpfulish +15

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.