Page 1 of 1

PB521 - Joystick Library HAT-POV

Posted: Wed Jan 22, 2014 4:58 pm
by luis
Linux Mint Mate x64

I've tried with this: Saitek Rumble Pad P480

Image

This is the test code:

Code: Select all

If InitJoystick()
    Debug JoystickName(0)
    pads = 3 : y = 10
    
     If OpenWindow(0, 10, 10, 320, 240, "Test Window", #PB_Window_SystemMenu)  
        For i = 0 To pads - 1
            TextGadget(g, 10, y, 600, 20, "") : g + 1 : y + 20
            TextGadget(g, 10, y, 600, 20, "") : g + 1 : y + 20
            TextGadget(g, 10, y, 600, 20, "") : g + 1 : y + 30
        Next
        
        Repeat 
            Event = WindowEvent()
            
            ExamineJoystick(0)
            
            For i = 0 To 2
                SetGadgetText(0 + 3 * i, "pad (" + i + "), X = " + JoystickAxisX(0, i, #PB_Relative))
                SetGadgetText(1 + 3 * i, "pad (" + i + "), Y = " + JoystickAxisY(0, i, #PB_Relative))
                SetGadgetText(2 + 3 * i, "pad (" + i + "), Z = " + JoystickAxisZ(0, i, #PB_Relative))
            Next
            
            Delay(100)
            
            Until Event = #PB_Event_CloseWindow   
     EndIf
    
EndIf

Under Win/Lin/OSX the two analog joysticks work, they are mapped on some axis on some PAD. OK.

The buttons also work.

The HAT (or POV) on the top left in the picture, works only under Windows.

It is seen on the X and Y axis on the PAD 2.
See image below (on Windows) where I'm pressing a diagonal to have both axis activated.

Image


On BOTH LINUX AND OSX the HAT doesn't work. I've tried with some other utility to test the Saitek and they correctly report the HAT status.

For example, under linux you can use jstest. If you don't have it installed you can on a debian-based distribution get it this way:

Code: Select all

sudo apt-get install joystick
And then try it this way (changing the device number as required):

Code: Select all

jstest /dev/input/js1

luis@MINT64-V16 ~ $ jstest --normal /dev/input/js1
Driver version is 2.1.0.
Joystick (Jess Tech Dual Analog Rumble Pad) has 6 axes (X, Y, Z, Rz, Hat0X, Hat0Y)
and 12 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6).
Testing ... (interrupt to exit)
Axes:  0:     0  1:     0  2:     0  3:     0  4: -32757 5: 32767 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 
The axes 4 and 5 above are again active because I'm pressing the HAT diagonally.

On OSX you can use this -> http://alphaomega.software.free.fr/joys ... ester.html


So, with other utilities the HAT does work on Lin/OSX, it just does not work with the PB joystick lib.

Re: PB521 - Joystick Library HAT-POV

Posted: Wed Jan 22, 2014 10:38 pm
by luis
Tried with this one too just to check something from a different manufacturer: Thrustmaster HOTAS.

Image

Same problem, the HAT doesn't work, under Windows it's OK.

Re: PB521 - Joystick Library HAT-POV

Posted: Thu Jan 23, 2014 4:32 pm
by heartbone
Good catch luis.
I can confirm the bug in Ubuntu 13.10 (running PB521-beta1).
The jstest-gtk interface correctly senses the gamepad POV switching.