Hi everyone!
Pointless Background
I’ve been using JOGL for the past several months and just love it. I’ve just started a new project where I’m building some custom hardware that will be USB (HID) compatible that I want to use to control interaction in my application.
This is the first time I’ve attempted to build custom hardware/drivers/etc so please forgive me if I’m asking the obvious here. There’s a venerable RAINFOREST of USB documentation that I’ve been trying to wade through and make sense of. I’m still very much in the research and design stage as far as software goes and want to make sure that I understand all of the options available to me before I waste several weeks (months?) writing a driver.
Start Reading Here
My question for you guys: does the Collection/Axis structure of a device directly correspond to the HID descriptor for a device?
For example, I wrote a quick recursive app that prints out the structure of my Microsoft USB Optical mouse. I found the following:
Controller: Mouse Mouse Axises [0] Controller: Mouse Mouse ball Axises [3] X-axis (x) Y-axis (y) Wheel (slider) Controller: Mouse Mouse buttons Axises [3] Button 0 (left) Button 1 (right) Button 2 (middle)
And the typical mouse HID (abbreviated) looks like this:
Usage_Page(Generic Desktop) Usage (Mouse) Collection(Application) Usage(Pointer) Collection(Physical) Usage_Page(Button) // then button 1, 2, 3 ... Usage_Page(Generic Desktop) // then x, y ... End Collection End Collection
So, let’s say that I added another Usage_Page under the “Physical Collection” that reported arbitrary values A, B, and C, would I see those as another Controller with three Axes (A, B, C) under the high level mouse controller?
Translation:
Controller: Mouse Mouse Axises [0] Controller: Mouse Mouse ball Axises [3] X-axis (x) Y-axis (y) Wheel (slider) Controller: Mouse Mouse buttons Axises [3] Button 0 (left) Button 1 (right) Button 2 (middle) Controller: Mouse Arbitrary values Axises [3] A (A) B (B) C (C)
Hope this isn’t too basic… just want to make sure that I understand what JInput is doing. If it will recognize my new device as I’ve specified above (or close to it if I got the controller/axis heirarchy wrong) then that means I just need to worry about the embedded software and don’t need to write a host driver… I can just import JInput into my application and keep coding!
Thanks for your help… you guys are doing great work.