Adding new Device Types

I have a few questions about adding device support to JInput.

What is the general policy for adding new device type/support for JInput?
In particular I am adding support for space navigators and touch screens.

(Questions about native code, only deal with GNU/Linux)
(using code from CVS)

  1. How often is the NativeDefinitions.java file generated?
    The javadoc in the header states it is generated from /usr/include/linux/input.h.
    Since the last time this file was generated, there have been some changes to the Linux evdev interface.
    In particular, the ioctl() function EVIOCGUSAGE and USAGE_* constants are no longer defined.
    The ioctl() call is made from net_java_games_input_LinuxEventDevice.c. Later, the USAGE_* constants
    are checked in net.java.games.input.LinuxEventDevice.guessType().
    I am using kernel version 2.6.18 (newish, but not bleeding edge)

  2. I am adding a new Controller type SPACE_NAV. Initially it will support the 3DConnection
    SpaceNavigator, though is not the only 6 DOF device on the market. Using the JInput code
    from CVS, the device is detected as a mouse. This type of device is usually used for navigation
    independent of the mouse. So I think it deserves a separate type.

  3. How do I submit my changes back to the project?

Thanks in advance,

-Pablo A. Maurin

Hi

  1. ok, sounds like we need to look at this. We need to make sure it works with kernels before 2.6.18, but it sounds like it does need some updating. I’m using 2.6.20, and it all seems to play quite happily at the moment. I take it the values are still OK, but the defines have been renamed?

  2. SPACE_NAV is more of a model, than a device type. I can see why you don’t want it detecting as a mouse, but I don’t think SPACE_NAV is right either. Maybe a name that includes the other 6 DOF devices would be more appropriate.

  3. The first few changes (each their own piece of work) will need to be submitted via an active developer, who will check the changes to make sure they fit in with JInput and our goals, if all goes well, we’ll add you to the list of developers so you have checkin access to CVS. Either way, you’ll need to fill in the contributers agreement, which is just to make sure you are not checking in code that you don’t have permission to do, and to say that you had give permission for JInput to use it.

HTH

Endolf