Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  .getPollData returns only -1 and 1 on OS X, with ART TECH GAME. Controller  (Read 1467 times)
0 Members and 1 Guest are viewing this topic.
Offline capsaicin

Junior Newbie





« Posted 2013-11-28 14:32:56 »

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:
1  
java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerReadTest


TestCode:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
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
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #1 - Posted 2013-11-28 14:59:19 »

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!

Offline capsaicin

Junior Newbie





« Reply #2 - Posted 2013-11-28 15:17:56 »

Unless you tell us what gamepad it is, I don't think we can help any further!

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline capsaicin

Junior Newbie





« Reply #3 - Posted 2013-12-02 08:18:28 »

Helo,

more infos about the device:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
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
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (42 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!