.getPollData returns only -1 and 1 on OS X, with ART TECH GAME. Controller

Hello,

I have a problem with a gamepad on os x, it returns only -1.0 and 1.0. It works on the same hardware running WinXP. The controller works with “joystick und gamepad tester.app” on os x, it returns values form -128 to 127, where 0 is at one end, -128 at middle stick and -1 at the other end.

I have test the device with:

java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerReadTest

TestCode:


public class foo {

    public static void main(String[] args) {
        Controller[] ca = ControllerEnvironment.getDefaultEnvironment().getControllers();
        Controller Tx=null;

        for(int i =0;i<ca.length;i++){
            System.out.println(ca[i].getName());
            if (!ca[i].getName().equals("ART TECH GAME.  ")) continue;
            Tx = ca[i];

            System.out.println("Type: "+Tx.getType().toString());

            /* Get this controllers components (buttons and axis) */
            Component[] components = Tx.getComponents();
            System.out.println("Component Count: "+components.length);
            for(int j=0;j<components.length;j++){

                /* Get the components name */
                System.out.println("Component "+j+": "+components[j].getName());
                System.out.println("    Identifier: "+ components[j].getIdentifier().getName());
                System.out.print("    ComponentType: ");
                if (components[j].isRelative()) {
                    System.out.print("Relative");
                } else {
                    System.out.print("Absolute");
                }
                if (components[j].isAnalog()) {
                    System.out.print(" Analog");
                } else {
                    System.out.print(" Digital");
                }
            }
        }

        while(true) {
          Tx.poll();
          Component[] components = Tx.getComponents();
          StringBuffer buffer = new StringBuffer();
          for(int i=0;i<components.length;i++) {
             if(i>0) {
                buffer.append(", ");
             }
             buffer.append(components[i].getName());
             buffer.append(": ");

              buffer.append(components[i].getPollData());
          }
          System.out.println(buffer.toString());

          try {
             Thread.sleep(20);
          } catch (InterruptedException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
        }


    }

}

Output:

ART TECH GAME.
Type: Stick
Component Count: 6
Component 0: x
    Identifier: x
    ComponentType: Absolute AnalogComponent 1: y
    Identifier: y
    ComponentType: Absolute AnalogComponent 2: z
    Identifier: z
    ComponentType: Absolute AnalogComponent 3: rx
    Identifier: rx
    ComponentType: Absolute AnalogComponent 4: ry
    Identifier: ry
    ComponentType: Absolute AnalogComponent 5: rz
    Identifier: rz
    ComponentType: Absolute AnalogApple Magic Mouse
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0
x: -1.0, y: -1.0, z: 1.0, rx: -1.0, ry: 1.0, rz: 1.0

any tips to debug this issue?

Thanks Maik

So, maybe input is processed differently. I think its working, its just now you need to use the new numbers it gives you. Unless you tell us what gamepad it is, I don’t think we can help any further!

[quote=“opiop65,post:2,topic:45306”]
Hobbyking 6CH RC Flight Simulator System (Mode 2):
http://www.hobbyking.com/hobbyking/store/_20951__hobbyking_6ch_rc_flight_simulator_system_mode_2.html
-----8<-----
ART TECH GAME. :
Product ID: 0x1a13
Vendor ID: 0x0603 (Novatek Microelectronics Corp.)
Version: 3.01
Speed: Up to 1.5 Mb/sec
Location ID: 0xfa120000 / 5
Current Available (mA): 500
Current Required (mA): 296
----->8-----

http://www.art-tech.com/english/ArticleShow.asp?ArticleID=321

Helo,

more infos about the device:


Low Speed device @ 7 (0xFD141000): .............................................   Composite device: "ART TECH GAME.  "
    Port Information:   0x0018
           Not Captive
           External Device
           Connected
           Enabled
    Number Of Endpoints (includes EP0):   
        Total Endpoints for Configuration 1 (current):   2
    Device Descriptor   
        Descriptor Version Number:   0x0100
        Device Class:   0   (Composite)
        Device Subclass:   0
        Device Protocol:   0
        Device MaxPacketSize:   8
        Device VendorID/ProductID:   0x0603/0x1A13   (Novatek Microelectronics Corp.)
        Device Version Number:   0x0301
        Number of Configurations:   1
        Manufacturer String:   0 (none)
        Product String:   34 "ART TECH GAME.  "
        Serial Number String:   0 (none)
    Configuration Descriptor (current config)   
        Length (and contents):   34
            Raw Descriptor (hex)    0000: 09 02 22 00 01 01 00 80  94 09 04 00 00 01 03 00  
            Raw Descriptor (hex)    0010: 00 00 09 21 00 01 00 01  22 28 00 07 05 81 03 08  
            Raw Descriptor (hex)    0020: 00 14 
        Number of Interfaces:   1
        Configuration Value:   1
        Attributes:   0x80 (bus-powered)
        MaxPower:   296 mA
        Interface #0 - HID   
            Alternate Setting   0
            Number of Endpoints   1
            Interface Class:   3   (HID)
            Interface Subclass;   0
            Interface Protocol:   0
            HID Descriptor   
                Descriptor Version Number:   0x0100
                Country Code:   0
                Descriptor Count:   1
                Descriptor 1   
                    Type:   0x22  (Report Descriptor)
                    Length (and contents):   40
                        Raw Descriptor (hex)    0000: 05 01 09 04 A1 01 09 01  A1 00 05 01 09 30 09 31  
                        Raw Descriptor (hex)    0010: 09 32 09 33 09 34 09 35  15 00 25 FF 35 00 45 FF  
                        Raw Descriptor (hex)    0020: 75 08 95 06 81 02 C0 C0  
                    Parsed Report Descriptor:   
                          Usage Page    (Generic Desktop) 
                          Usage (Joystick)    
                              Collection (Application)    
                                Usage (Pointer)    
                                    Collection (Physical)    
                                      Usage Page    (Generic Desktop) 
                                      Usage (X)    
                                      Usage (Y)    
                                      Usage (Z)    
                                      Usage (Rx)    
                                      Usage (Ry)    
                                      Usage (Rz)    
                                      Logical Minimum.........    (0)  
                                      Logical Maximum.........    (-1)  
                                      Physical Minimum........    (0)  
                                      Physical Maximum........    (-1)  
                                      Report Size.............    (8)  
                                      Report Count............    (6)  
                                      Input...................   (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null Position, Bitfield) 
                                    End Collection     
                              End Collection     
            Endpoint 0x81 - Interrupt Input   
                Address:   0x81  (IN)
                Attributes:   0x03  (Interrupt)
                Max Packet Size:   8
                Polling Interval:   20 ms