There are a couple solutions out there in the form of APIs for detecting GamePad input, but I can't find how it's done from scratch. I ran a test for a couple types of listeners, and they don't seem to detect the button presses on my XBOX360 controller. I don't know where to begin... do I need to write my own drivers? How does JInput do it?
Asked
Active
Viewed 894 times
0
-
Update: I just looked at the .jar for JInput... it's huge. Plus, it appears to be written in more than one language, probably c/c++. =( – MrMysterious2502 Apr 15 '14 at 11:12
-
It depends a bit on how the controller is installed. Is it a USB HID device? or some closed protocol? Are you using windows/macos/linux? And why do you don't want to use JInput? – Absurd-Mind Apr 15 '14 at 11:22
-
I'm interested in knowing what it takes to make my own implementation, because, as I said, JInput is huge. If i could do it with a substantially smaller amount of source code, it might be worth it. Plus, you've got to love proprietary programming! I mean... writing a GamePad api/plugin of your very own would just be totally sweet. And yes, it's a USB HID device; it's an XBOX360 controller, wired. – MrMysterious2502 Apr 15 '14 at 17:12
-
Then i would suspect that either some generic listener will output the keycodes or you would have to write some (maybe native) code which opens the device (e.g. /dev/mouse2 under linux) and parses the codes which are received. – Absurd-Mind Apr 15 '14 at 18:28
-
Yuck. I'll just use JInput. You've got to pick your battles. I'm a graphics programmer, not a hardware/driver programmer. Thanks anyway. – MrMysterious2502 Apr 20 '14 at 05:26