🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Input device programming question

Started by
2 comments, last by Sneftel 13 years, 8 months ago
Hey guys,


I was wondering if someone could help me out. I'm wondering if there is an equivalent input programming method in linux to the Raw Input programming in Windows.

I can look up resources and tutorials on whatever it is, I'm just not sure what I should be looking for.

Thanks for any help here..


Michael
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
Advertisement
If you're dealing with usb devices and joysticks you could look at libusb, which provides userland access to the usb stack. I have some example code on my (dead) desktop which uses this to interface with a saitek X52 pro flight stick and set its LCD display and light colours.
Is this the sort of thing you need?
I don't know what Raw Input on Windows is, but of you want to bypass what the system provides for you and get input directly from the Linux kernel, your best bet is through the /dev/input nodes. Try the lsinput command to see what kinds of input devices you have available.

You can, of course, grab the source code to lsinput to see how it works.

You will need to run that command as root, because normal applications aren't supposed to be accessing the hardware directly like that.

Stephen M. Webb
Professional Free Software Developer

/dev/usb/hiddev* provide raw HID input. It's a little lower level than Windows RawInput stuff, though. If you want something more user-friendly, you'll have to describe what particular aspects of input you want that aren't provided by Win32/DirectInput/XInput.

This topic is closed to new replies.

Advertisement