Advertisement

Input device programming question

Started by October 05, 2010 04:40 PM
2 comments, last by Sneftel 14 years, 3 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
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?
Advertisement
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